Skip to content

Commit

Permalink
Enhancement with cli option (#16)
Browse files Browse the repository at this point in the history
* chore: CLI commands added

* chore: moved cli code to src folder

* chore: cli commands for indices

* chore: exclude cli on docs

* chore: added test case and interface for getEquityStockIndices

* chore: docs updated

* chore: readme updated

* chore: version updated

* chore: docs updated
  • Loading branch information
asrafalih authored Dec 31, 2021
1 parent a2334fd commit 7232f4a
Show file tree
Hide file tree
Showing 36 changed files with 1,957 additions and 243 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,46 @@ nseIndia.getAllStockSymbols().then(symbols => {
nseIndia.getEquityDetails('IRCTC').then(details => {
console.log(details)
})
```
## CLI

We can use this package in CLI.

Install for CLI

```sh
npm i -g stock-nse-india
```

### CLI Usage

To get CLI help

```sh
nseindia --help
```

To get market status
```sh
nseindia
```

To get the current equity details of the NSE symbol
```sh
nseindia equity IRCTC
```

To get the historical details of the NSE symbol
```sh
nseindia historical IRCTC
```

To get the details of the indices
```sh
nseindia index
```

To get the details of the specific index
```sh
nseindia index "NIFTY AUTO"
```
2 changes: 1 addition & 1 deletion docs/assets/js/search.js

Large diffs are not rendered by default.

55 changes: 41 additions & 14 deletions docs/classes/index.nseindia.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>NseIndia | stock-nse-india - v1.0.1</title>
<meta name="description" content="Documentation for stock-nse-india - v1.0.1">
<title>NseIndia | stock-nse-india - v1.0.2</title>
<meta name="description" content="Documentation for stock-nse-india - v1.0.2">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
Expand All @@ -23,7 +23,7 @@
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">stock-nse-india - v1.0.1</a>
<a href="../index.html" class="title">stock-nse-india - v1.0.2</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
Expand Down Expand Up @@ -52,7 +52,7 @@
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../modules.html">stock-nse-india - v1.0.1</a>
<a href="../modules.html">stock-nse-india - v1.0.2</a>
</li>
<li>
<a href="../modules/index.html">index</a>
Expand Down Expand Up @@ -97,6 +97,7 @@ <h3>Methods</h3>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="index.nseindia.html#getequityhistoricaldata" class="tsd-kind-icon">get<wbr>Equity<wbr>Historical<wbr>Data</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="index.nseindia.html#getequityintradaydata" class="tsd-kind-icon">get<wbr>Equity<wbr>Intraday<wbr>Data</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="index.nseindia.html#getequityseries" class="tsd-kind-icon">get<wbr>Equity<wbr>Series</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="index.nseindia.html#getequitystockindices" class="tsd-kind-icon">get<wbr>Equity<wbr>Stock<wbr>Indices</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="index.nseindia.html#getequitytradeinfo" class="tsd-kind-icon">get<wbr>Equity<wbr>Trade<wbr>Info</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="index.nseindia.html#getindexintradaydata" class="tsd-kind-icon">get<wbr>Index<wbr>Intraday<wbr>Data</a></li>
</ul>
Expand Down Expand Up @@ -133,7 +134,7 @@ <h3>get<wbr>All<wbr>Stock<wbr>Symbols</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L86">index.ts:86</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L87">index.ts:87</a></li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4>
Expand All @@ -150,7 +151,7 @@ <h3>get<wbr>Data</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L58">index.ts:58</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L59">index.ts:59</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -173,7 +174,7 @@ <h3>get<wbr>Data<wbr>ByEndpoint</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L83">index.ts:83</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L84">index.ts:84</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -196,7 +197,7 @@ <h3>get<wbr>Equity<wbr>Corporate<wbr>Info</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L96">index.ts:96</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L97">index.ts:97</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -219,7 +220,7 @@ <h3>get<wbr>Equity<wbr>Details</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L90">index.ts:90</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L91">index.ts:91</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -242,7 +243,7 @@ <h3>get<wbr>Equity<wbr>Historical<wbr>Data</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L107">index.ts:107</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L108">index.ts:108</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -268,7 +269,7 @@ <h3>get<wbr>Equity<wbr>Intraday<wbr>Data</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L99">index.ts:99</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L100">index.ts:100</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -294,7 +295,7 @@ <h3>get<wbr>Equity<wbr>Series</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L121">index.ts:121</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L121">index.ts:121</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -307,6 +308,29 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getequitystockindices" class="tsd-anchor"></a>
<h3>get<wbr>Equity<wbr>Stock<wbr>Indices</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Equity<wbr>Stock<wbr>Indices<span class="tsd-signature-symbol">(</span>index<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/interface.indexdetails.html" class="tsd-signature-type" data-tsd-kind="Interface">IndexDetails</a><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L124">index.ts:124</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>index: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/interface.indexdetails.html" class="tsd-signature-type" data-tsd-kind="Interface">IndexDetails</a><span class="tsd-signature-symbol">&gt;</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getequitytradeinfo" class="tsd-anchor"></a>
<h3>get<wbr>Equity<wbr>Trade<wbr>Info</h3>
Expand All @@ -317,7 +341,7 @@ <h3>get<wbr>Equity<wbr>Trade<wbr>Info</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L93">index.ts:93</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L94">index.ts:94</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -340,7 +364,7 @@ <h3>get<wbr>Index<wbr>Intraday<wbr>Data</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/91ec22d/src/index.ts#L124">index.ts:124</a></li>
<li>Defined in <a href="https://github.com/hi-imcodeman/stock-nse-india/blob/4fca7ce/src/index.ts#L127">index.ts:127</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -412,6 +436,9 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="index.nseindia.html#getequityseries" class="tsd-kind-icon">get<wbr>Equity<wbr>Series</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="index.nseindia.html#getequitystockindices" class="tsd-kind-icon">get<wbr>Equity<wbr>Stock<wbr>Indices</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="index.nseindia.html#getequitytradeinfo" class="tsd-kind-icon">get<wbr>Equity<wbr>Trade<wbr>Info</a>
</li>
Expand Down
Loading

0 comments on commit 7232f4a

Please sign in to comment.