
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
ipfs-gateway-race
Advanced tools
npm install ipfs-gateway-race
Import the library in your application and create a gateway racer like:
import { createGatewayRacer } from 'ipfs-gateway-race'
const gwRacer = createGatewayRacer(
['https://ipfs.io', 'https://cf-ipfs.com']
)
Get a IPFS response by given CID.
interface IpfsGatewayRaceGetOptions {
pathname?: string
headers?: Headers
noAbortRequestsOnWinner?: boolean
onRaceEnd?: (gwResponsePromises: GatewayResponsePromise[], winnerResponse: GatewayResponse | undefined) => void
}
get(cid: string, options: IpfsGatewayRaceGetOptions): Promise<Response>
Example:
import { createGatewayRacer } from 'ipfs-gateway-race'
const gwRacer = createGatewayRacer(['https://ipfs.io', 'https://cf-ipfs.com'])
const response = await gwRacer.get(
'bafybeiedv7sowwxamly4oicivudp45rsfvbklnf3fvbvonxrwoxqylhtwq',
{ pathname: '/0.json' }
)
Feel free to join in. All welcome. Open an issue!
If you're opening a pull request, please see the guidelines in DEVELOPMENT.md on structuring your commit messages so that your PR will be compatible with our release process.
Dual-licensed under MIT + Apache 2.0
FAQs
Races given IPFS Gateways to resolve provided CID
We found that ipfs-gateway-race demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.