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 🙏

© 2026 – Pkg Stats / Ryan Hefner

iran-stock

v1.4.0

Published

Live and historical Iran stock market status

Readme

iran-stock

Nodejs package for live and historical Iran stock market status

Install

npm i iran-stock

API

status()

This method fetches latest status of iran stocks.

const iranStock = require('iran-stock')

// get all stocks, then print count and information of the first stock
iranStock.status()
.then(stocks => {

  console.log(stocks.length, stocks[0])

  /* output:
  1002 {
  code: '143187001116603', // stock code
  ISIN: 'IRO6MELZ96C1',
  symbol: 'تملي612',
  company: 'تسهيلات مسكن بانك ملي-اسفند96',
  opening: '256029', // price
  closing: '256029', // price
  last: '256029', // price
  count: '1', // of trades
  volume: '2', // of trades
  value: '512058', // of trades
  lowest: '256029', // price
  highest: '256029', // price
  yesterday: '269504', // price
  EPS: ''
  }
  */

}, err => {
  console.log(err)
})

history()

This method provides historical daily price information for a specific stock.

const iranStock = require('iran-stock')

iranStock.history({
  // stock code
  code: '41302553376174581',
  // start date in yyyymmdd format
  startDate: '20200621',
  // end date in yyyymmdd format
  endDate: '20200623'
})
.then(records => {

  console.log(records)
  /* output:
  [
    {
      date: '20200620',
      first: '44930.00',
      highest: '45100.00',
      lowest: '43980.00',
      closing: '44940.00',
      value: '293808929810',
      volume: '6538132',
      opening: '42960.00'
    },
    {
      date: '20200621',
      first: '45000.00',
      highest: '47180.00',
      lowest: '43400.00',
      closing: '45140.00',
      value: '391701775190',
      volume: '8677526',
      opening: '44940.00'
    },
    {
      date: '20200622',
      first: '47390.00',
      highest: '47390.00',
      lowest: '47390.00',
      closing: '46930.00',
      value: '43849824830',
      volume: '925297',
      opening: '45140.00'
    }
  ]
  */

}, err => {
  console.log(err)
})

Example

Below example fetches price list of a specific stock in June 2020.

const iranStock = require('iran-stock')

async function load() {
  try {

    // get stock list
    const stocks = await iranStock.status()
    console.log('stock data received')

    // find the 'فجر' stock
    const myStock = stocks.filter(stock => stock.symbol == 'فجر')[0]
    if (!myStock) {
      console.log('stock not found')
      return;
    }
    console.log('stock found')

    // get price history for the stock
    const prices = await iranStock.history({
      // stock code
      code: myStock.code,
      // start date in yyyymmdd format
      startDate: '20200601',
      // end date in yyyymmdd format
      endDate: '20200630'
    })
    console.log(prices)

  } catch (err) {
    console.log('error', err)
  }
}

load()