Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Q: Why? There is allready an existing one finnhub-js
A: Because it's not working in every enviroment
Environment
Language level
Module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via package.json
. (Reference)
Get your API-Key: https://finnhub.io/register
import { DefaultApi } from 'finnhub-ts'
const finnhubClient = new DefaultApi({
apiKey: 'YOUR-API-KEY',
isJsonMime: (input) => {
try {
JSON.parse(input)
return true
} catch (error) {}
return false
},
})
//@ts-ignore
finnhubClient.axios.interceptors.response.use(
(response) => response,
(error) => {
switch (error.code) {
case 'ERR_BAD_REQUEST':
// API limit for example (30 calls/second)
console.log(error.response.data.error)
break
default:
console.log('error: ', error)
}
}
)
companyEarnings('AAPL').then((res) => {
console.log(res.data)
})
Output:
[
{
"actual": 2.56,
"estimate": 2.38,
"period": "2019-03-31",
"symbol": "AAPL"
},
{
"actual": 4.21,
"estimate": 4.15,
"period": "2018-12-31",
"symbol": "AAPL"
},
{
"actual": 2.88,
"estimate": 2.75,
"period": "2018-09-30",
"symbol": "AAPL"
},
{
"actual": 2.32,
"estimate": 2.11,
"period": "2018-06-30",
"symbol": "AAPL"
}
]
Official Docs and API info
const {
aggregateIndicator,
bondPrice,
bondProfile,
companyBasicFinancials,
companyEarnings,
companyEarningsQualityScore,
companyEbitEstimates,
companyEbitdaEstimates,
companyEpsEstimates,
companyEsgScore,
companyExecutive,
companyNews,
companyPeers,
companyProfile,
companyProfile2,
companyRevenueEstimates,
country,
covid19,
cryptoCandles,
cryptoExchanges,
cryptoProfile,
cryptoSymbols,
earningsCalendar,
economicCalendar,
economicCode,
economicData,
etfsCountryExposure,
etfsHoldings,
etfsProfile,
etfsSectorExposure,
fdaCommitteeMeetingCalendar,
filings,
filingsSentiment,
financials,
financialsReported,
forexCandles,
forexExchanges,
forexRates,
forexSymbols,
fundOwnership,
indicesConstituents,
indicesHistoricalConstituents,
insiderSentiment,
insiderTransactions,
internationalFilings,
investmentThemes,
ipoCalendar,
marketNews,
mutualFundCountryExposure,
mutualFundHoldings,
mutualFundProfile,
mutualFundSectorExposure,
newsSentiment,
ownership,
patternRecognition,
pressReleases,
priceTarget,
quote,
recommendationTrends,
revenueBreakdown,
similarityIndex,
socialSentiment,
stockBasicDividends,
stockBidask,
stockCandles,
stockDividends,
stockLobbying,
stockNbbo,
stockSplits,
stockSymbols,
stockTick,
stockUsaSpending,
stockUsptoPatent,
stockVisaApplication,
supplyChainRelationships,
supportResistance,
symbolSearch,
technicalIndicator,
transcripts,
transcriptsList,
upgradeDowngrade,
} = finnhubClient
Swagger file: swagger.json
OpenAPI Client: openapi-generator-cli.jar
How generate new version:
java -jar .\openapi-generator-cli.jar generate -i .\swagger.json -o .\ -g typescript-axios --skip-validate-spec -c .\openapi-generator.json
FAQs
OpenAPI client for finnhub-ts
The npm package finnhub-ts receives a total of 21 weekly downloads. As such, finnhub-ts popularity was classified as not popular.
We found that finnhub-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.