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.
A CLI that helps you create quick and fast hosted API/mocks for easy prototyping.
# via npm
npm install -g apimocka
# via yarn
yarn global add apimocka
# register an account
apimocka register
#...
# login to your account
apimocka login
{
"total": 5,
"name": "trial",
"routes": {
"users": {
"fullname": "name.firstName name.lastName",
"avatar": "internet.avatar",
"username": "internet.userName",
"password": "internet.password"
}
}
}
save file as trialMock.json
To learn more about customizing your mock config file, check here
apimocka deploy path/to/trialMock.json
After creating a new mock, you get a personalized URL in the format:
https://mockd.co/{mockId}
All requests made to the mockd.co
server must have the content-type header set to application/json
Path (https://mockd.co/{projectId}) | Allowed Request type | Description |
---|---|---|
/ | GET | fetches all mock information |
/{route} | GET | fetches all data in specified route |
POST | Adds new data to route | |
/{route}/{id} | GET | Fetches data in specified index |
PUT | Replaces any specified field with new data | |
DELETE | Delete specified index and all it's child contents | |
/{route}/verify | POST | Pass any object and verify if any match exists in specified route |
A mock configuration file is used to specify mock settings, routes structure, and total number of data to mock for each route.
The mock data is generated using the faker API
Format: JSON
or YAML
A simple configuration file looks like:
JSON format:
{
"total": 5,
"name": "trial",
"routes": {
"users": {
"fullname": "name.firstName name.lastName",
"avatar": "internet.avatar",
"username": "internet.userName",
"password": "internet.password"
}
}
}
YAML format:
---
total: 5
name: trial
routes:
users:
fullname: name.firstName name.lastName
avatar: internet.avatar
username: internet.userName
password: internet.password
Command | Description |
---|---|
register | Create a new APImocka account |
login | Authenticate to your APImocka account |
list | Show all your available mocks |
deploy [configFile] | Create a new mock from config file |
delete [mockId] | Delete an existing mock |
Command | Description |
---|---|
localize [mockId] | Run a local version of existing mock |
FAQs
Create quick hosted mock data from terminal
We found that apimocka 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.