Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
A lightweight Promise based HTTP client, using Fetch API.
npm i --save fitch
** With ES2015 or TypeScript:**
import fitch from 'fitch'
CommonJS:
const fitch = require('fitch')
UMD:
<script src="node_modules/fitch/src/index.js"></script>
fitch.get(apiUrl)
.then(data => console.log(data))
fitch.get(apiUrl)
.then(data => console.log(data))
const req = {body: {name: 'Happy cat'}}
fitch.post(apiUrl, req)
.then(data => console.log(data))
const req = {body: {name: 'Happy cat'}}
fitch.put(apiUrl, req)
.then(data => console.log(data))
const req = {body: {name: 'Happy cat'}}
fitch.patch(apiUrl, req)
.then(data => console.log(data))
fitch.delete(apiUrl)
.then(data => console.log(data))
const config = {
cache = 'no-store',
headers = { 'Content-Type': 'application/json' },
mode = 'no-cors',
raw = true, // return the raw output of fetch()
params: { // transform to '?test1=test-1&test2=test-2'
test1: 'test-1',
test2: 'test-2',
},
}
fitch.get(apiUrl, config)
.then(data => console.log(data))
See more about fetch configuration at: Fetch API.
Note: This assumes that you’re using a transpiler like Babel.
Note: modern browsers such as Chrome, Firefox, and Microsoft Edge contain native implementations of window.fetch, so the polyfill doesn't have any affect on those browsers. See more at window.fetch polyfill.
First yout need to fork this repository. Then:
npm i # install local dependencies
npm start # run local server
npm run watch:test # watch files inside src/ and tests/
npm run examples # run examples
Note: Your code must be tested and pass in linter check.
You can verify your code with ESLint, using npm run lint
.
FAQs
A lightweight Promise based HTTP client, using Fetch API.
We found that fitch 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.