
Security News
Socket Integrates With Bun 1.3’s Security Scanner API
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
A package that allows the caller to extrace SWIFT codes published by the http://bank.codes service
Add to your project from the NPM repository:
npm install bank-codes --save
and grab an instance:
// using ES6 modules
import bc from 'bank-codes';
// using CommonJS modules
const bc = require('bank-codes');
The methods in this package store the data retrieved into a cache.json
file. This package contains such a file and most clients will simply want to use it directly, rather than scanning the site for the data. The file may be included like this:
const bc = require('bank-codes/cache.json')
The following methods are available in the package:
Returns an object keyed by country names and values a path within the site see a list of banks
{
"United States": "/swift-code/united-states/"
}
Retrieves the list of banks for the given country. The return value is similar that below:
[
{
"Name": "1ST PMF BANCORP",
"City": "LOS ANGELES",
"Branch": "",
"SWIFT": "PMFAUS66HKG"
}
]
The methods return promises so their return values need to be waited for
// as a promise
bc.banks('United States').then(console.log);
// async/await
(async () => {
console.log(await bc.banks('United States'));
})()
The cache file produced when calling package methods may become stale across time and can be regenerated by running:
npm run cache
Additionally, country lists of banks can be generated on the command line by adding the country names to the command (titlecased) e.g.
npm run cache Mexico Sweden
will output progress information to stderr and the output to stdout so it can be captured:
npm run cache Mexico > Mexico.json
If you add functionality, make sure tests pass:
npm test
and when publishing, bump up the version like this:
npm version <patch|minor|major>
ISC
For support post an issue on Github or reach out to me directly @ekkis on Telegram
FAQs
An extraction facility for https://bank.codes
We found that bank-codes 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.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.