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.
The package takes json
or plain object
and turns it into a RESTful API server running on a given port (defaults to 8000
).
$ npm install apit
# OR
$ yarn add apit
Or to use as CLI:
$ npm -g install apit
# OR
$ yarn global add apit
const apit = require('apit')
const data = {
posts: {
foo: {
message: 'hello'
}
},
other: 'foo',
baz: [1,2,3],
food: {
steal: {
healthy: true
}
}
}
apit(data)
{"pid":54578,"hostname":"Tiaan-FF-Mac.local","name":"brewski","level":30,"time":1501775589826,"msg":"Server listening at http://localhost:3000","v":1}
The above example will create the following routes with associated values:
If you install the module globally, you can also use it with a json
file or module that exports a object
:
apit --file=example.json
# {"pid":56017,"hostname":"Tiaan-FF-Mac.local","name":"brewski","level":30,"time":1501776268494,"msg":"Server listening at http://localhost:8000","v":1}
Contributions are welcome!
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
Or open up a issue.
Licensed under the MIT License.
FAQs
JSON/Object to REST API with zero effort
The npm package apit receives a total of 1 weekly downloads. As such, apit popularity was classified as not popular.
We found that apit 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.