nepse-api-helper
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "nepse-api-helper", | ||
"version": "1.1.0", | ||
"description": "a wrapper to use nepse api easily since they set up weird restrictions", | ||
"keywords": ["nepse", "api", "nepal stock", "nepal"], | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"repository": "git@github.com:dahsameer/nepse-api-helper.git", | ||
"author": "Sameer Dahal", | ||
"license": "UNLICENSED", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"typescript": "^4.6.3" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "export NODE_TLS_REJECT_UNAUTHORIZED='0' && node --experimental-fetch dist/index.js" | ||
} | ||
} | ||
"name": "nepse-api-helper", | ||
"version": "1.2.0", | ||
"description": "a wrapper to use nepse api easily since they set up weird restrictions", | ||
"keywords": [ | ||
"nepse", | ||
"api", | ||
"nepal stock", | ||
"nepal" | ||
], | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"repository": "git@github.com:dahsameer/nepse-api-helper.git", | ||
"author": "Sameer Dahal", | ||
"license": "UNLICENSED", | ||
"devDependencies": { | ||
"typescript": "^5.1.3", | ||
"vitest": "^0.32.2" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "vitest" | ||
} | ||
} |
# nepse-api-helper | ||
Nepse has made it really hard to use their API, you can read more on how to | ||
this library was implemented in this doc [https://github.com/dahsameer/nepse-api-document](https://github.com/dahsameer/nepse-api-document) | ||
Nepse has made it really hard to use their API, this library just makes it easier to do stuff i guess | ||
works as of 2022-24-08 | ||
works as of 2023-06-25 | ||
@@ -11,16 +10,16 @@ you can install from npm using `npm install nepse-api-helper` | ||
```javascript | ||
import { UpdateSecurityBriefs, GetSecurityDetail, GetSecurityBriefs, GetMarketStatus } from "nepse-api-helper"; | ||
import { get_access_token, get_valid_token, get_market_status, instantiate_nepse_helper, get_security_detail, get_security_briefs } from "nepse-api-helper"; | ||
//at first before anything, call UpdateSecurityBriefs. This is required to get a cache of security id and symbol | ||
await UpdateSecurityBriefs(); | ||
//at first before anything, call instantiate_nepse_helper(). This is required to get the deobsfucation logic for token. | ||
await instantiate_nepse_helper(); | ||
//now you can use the functions that you need. for example | ||
const securityLists = await GetSecurityBriefs(); //this will return a list of all securities including active and inactive, with their status. | ||
const securityLists = await get_security_briefs(); //this will return a list of all securities including active and inactive, with their status. | ||
//get the detials of a security | ||
const securityDetail = await GetSecurityDetail('NIFRA'); | ||
const securityDetail = await get_security_detail('NIFRA'); | ||
//if you want to check if market is open or not, you can use, GetMarketStatus | ||
const marketStatus = await GetMarketStatus(); | ||
const marketStatus = await get_market_status(); | ||
``` | ||
@@ -38,1 +37,3 @@ | ||
``` | ||
have a look at tests to get basic understanding of how it works |
@@ -27,3 +27,3 @@ { | ||
/* Modules */ | ||
"module": "commonjs", /* Specify what module code is generated. */ | ||
"module": "NodeNext", /* Specify what module code is generated. */ | ||
// "rootDir": "./", /* Specify the root folder within your source files. */ | ||
@@ -30,0 +30,0 @@ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31858
19
551
2
2
5