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.
sync-fetch
Advanced tools
Synchronous wrapper around the Fetch API. Uses node-fetch
under the hood, and for some input-parsing code and test cases too.
npm install sync-fetch
In the browser, a browserify bundle can be loaded from CDNs like unpkg.com.
<script src="https://unpkg.com/sync-fetch"></script>
<script src="https://unpkg.com/sync-fetch@VERSION"></script>
const fetch = require('sync-fetch')
const metadata = fetch('https://doi.org/10.7717/peerj-cs.214', {
headers: {
Accept: 'application/vnd.citationstyles.csl+json'
}
}).json()
// arrayBuffer(), blob(), buffer(), json(), and text() supported
Stream
or Blob
as input body since they cannot be read or serialized synchronouslyFormData
as input body yet as it has no built-in method to be serializedagent
option as its value cannot be serializedtextConverted()
method on SyncResponse
and SyncRequest
XMLHttpRequest
is pretty limited. Supported are:
method
body
headers
credentials
(but not omit
)timeout
buffer()
and textConverted()
methods are not supportedFAQs
Synchronous version of the Fetch API
We found that sync-fetch demonstrated a healthy version release cadence and project activity because the last version was released less than 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.