npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

all-nse

v1.1.1

Published

A simple Node.js package to fetch stock data from NSE India

Readme

📦 All_NSE JavaScript Package

A lightweight module to fetch live stock price data and full equity quote data from NSE India using fetch and cookies handling.


📁 Installation

You can use it directly in your project:

npm install all-nse

Ensure you're running it in a Node.js environment that supports fetch (Node.js v18+ or polyfilled).


🚀 Usage

image

📚 API Reference

🔹 new All_NSE()

Creates a new instance of the NSE API class.


🔹 async getCookie(symbol: string): Promise<string>

Fetches required session cookies for a given NSE stock symbol.

  • symbol: string - NSE ticker symbol (e.g., 'INFY')
  • Returns: string - Parsed cookies string

🔹 async getData(symbol: string): Promise<Object | null>

Fetches the full equity quote data from NSE for a symbol.

  • symbol: string - NSE ticker symbol
  • Returns: Object - Complete NSE response (includes priceInfo, metadata, securityInfo, etc.)

🔹 async getLiveData(symbol: string): Promise<Object | null>

Fetches only the priceInfo field from NSE for a given symbol.

  • symbol: string
  • Returns: Object – Example structure:
{
  "lastPrice": 401,
  "change": -5.39,
  "pChange": -1.32,
  "previousClose": 406.4,
  "open": 406,
  "close": 401.65,
  "vwap": 404.07,
  "lowerCP": "386.10",
  "upperCP": "426.70",
  "intraDayHighLow": { "min": 396.65, "max": 413.4, "value": 401 },
  "weekHighLow": {
    "min": 124.25,
    "minDate": "05-Jun-2024",
    "max": 600,
    "maxDate": "30-Sep-2024",
    "value": 401
  }
}

🛡️ Notes

  • This package simulates browser-like behavior by using cookies.
  • NSE actively blocks scraping. Rotate user-agents and IPs if necessary.
  • Always use for educational or personal projects; respect NSE's terms of service.

📜 Legal Stuff

all-nse is distributed under the Apache Software License. See the LICENSE.txt file in the release for full details.

⚠️ DISCLAIMER: all-nse is not affiliated, endorsed, or vetted by the National Stock Exchange of India (NSE). It's an open-source tool that uses NSE’s publicly available data, and is intended for research and educational purposes. You should refer to NSE’s terms of use for details on your rights to use the actual data downloaded.

You should refer to NSE’s terms of use for detailed information on your rights and limitations in using their data.