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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bse-api-package

v1.2.1

Published

A Node.js package to fetch data from the Bombay Stock Exchange (BSE).

Downloads

29

Readme

BSE-API-PACKAGE

BSE-API-PACKAGE is a Node.js library that facilitates downloading and extracting ZIP files containing Bhavcopy (trading data) from the Bombay Stock Exchange (BSE) website.

Installation

Install the package via npm:

npm install bse-api-package

Features

  • Download and extract ZIP files containing Bhavcopy data from BSE for a specific date or date range.
  • Retrieve today's Bhavcopy data directly.
  • Save extracted files to a specified output directory.

Usage

Importing the Module

const BSEDownloader = require('bse-api-package');
const downloader = new BSEDownloader();

Download and Extract Today's Data


const outputDir = '/path/to/your/output/directory';

downloader.downloadTodayData(outputDir)
  .then(success => {
    if (success) {
      console.log('Downloaded and extracted ZIP for today');
    } else {
      console.log('Failed to download or extract ZIP for today');
    }
  })
  .catch(error => {
    console.error('Error:', error.message);
  });

Download and Extract specific date Data


const outputDir = '/path/to/your/output/directory';
const date =new Date('2023-05-27');

downloader.downloadForDate(date, outputDir)
  .then(success => {
    if (success) {
      console.log('Downloaded and extracted ZIP for today');
    } else {
      console.log('Failed to download or extract ZIP for today');
    }
  });

Download Data for a Date Range


const outputDir = '/path/to/your/output/directory';
const startDate = new Date('2023-06-27');
const endDate = new Date('2023-06-30');

downloader.downloadDataForDateRange(startDate, endDate, outputDir)
  .then(success => {
    if (success) {
      console.log(`Downloaded and extracted ZIP files between ${startDate} and ${endDate}`);
    } else {
      console.log(`Failed to download or extract ZIP files between ${startDate} and ${endDate}`);
    }
  })
  .catch(error => {
    console.error('Error:', error.message);
  });

API Documentation

downloadTodayData(outputDir: string): Promise<boolean> Downloads and extracts the Bhavcopy ZIP file for today's date.

  • outputDir: The directory path where the extracted files will be saved.

downloadForDate(date: Date,outputDir: string): Promise<boolean> Downloads and extracts the Bhavcopy ZIP file for given date.

  • outputDir: The directory path where the extracted files will be saved.

downloadDataForDateRange(startDate: Date, endDate: Date, outputDir: string): Promise<boolean> Downloads and extracts Bhavcopy ZIP files for a date range.

  • startDate: The start date (inclusive) of the date range.
  • endDate: The end date (inclusive) of the date range.
  • outputDir: The directory path where the extracted files will be saved.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Explanation:

  • Installation: Provides instructions on how to install the package using npm.

  • Features: Lists the main features of the BSE-API-PACKAGE package.

  • Usage: Demonstrates how to import the module, use methods to download and extract ZIP files, and handle success or failure callbacks.

  • API Documentation: Detailed documentation for each method, including parameters and return types.

  • License: Information about the licensing of the package.

You can adjust the paths, error handling, and logging as per your specific application requirements. This README.md file should provide a clear guide for users on how to install, use, and understand your BSE-API-PACKAGE package. Adjust the examples and descriptions based on any additional functionality or customization you provide in your library.

Note:

This is only for study purpose