
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Stubber.js a lightweight Resourcefully RESTful Stub API provider. Currently it only supports it's own propriatory format, but plans are to support multiple output formats to allow it to simulate any RESTful API.
See Planned Features for more details
NOTE: This document is a work in progress! Please submit Pull requests with updates/fixes to the project or the documentation.
Too many times of needing to stand up a temporary stub provider for data that would eventually be replaced with a real RESTful web service. Stubber was started as a generic solution to this problem with the idea of placing it behind a gateway provider that would do any additional transformations of the data as necessary and would be switched over to point at a live provider once one was available.
npm install stubber
Stubber.js is configured by setting the appropriate values in the config.json file within its root path. The default config.json file is:
{
default: {
web: {
webroot: './webroot',
port: 8080
},
mongo: {
connectionString: 'mongodb://localhost:27017/stubber'
}
}
}
All endpoints are documented at :// Where HTTP Method is the name of the appropriate HTTP Method to envoke on the resource and resource path is the actual path that the resource resides at. When dynamic properties (or variable values) are concerned the reference name is preceeded by a :
Provides a pagged listing of all available schemas known within the running instance of Stubber.js
Provides just the JSON-Schema schema for a particular schema by name (Resource Name). Use this for linking your JSON-Schema's together.
Provides a pagged listing of known resource types within the running instance of Stubber.js
Creates a new resource type within the running instance of Stubber.js
Creates a new resource type within the running instance of Stubber.js NOTE: You really should use POST://api/v1/resource instead of PUT://api/v1/resource
Gets a specific resource by identity and returns its details including the schema attached to it.
Updates a specific resource by identity.
Updates a specific resource by identity. NOTE: You really should use PUT://api/v1/resource/:id instead of POST://api/v1/resource/:id
Deletes a specific resource by identity.
Provides a pagged listing of all of the stub records for the specific resource requested.
Creates a new stub for the named resource within the running instance of Stubber.js
Creates a new stub for the named resource within the running instance of Stubber.js NOTE: You really should use POST://stub/:resourceName instead of PUT://stub/:resourceName
Gets a specific stub by identity from a named resource and returns its details back to the caller.
Updates a specific stub by identity from the named resource.
Updates a specific stub by identity from the named resource. NOTE: You really should use PUT://stub/:resourceName/:id instead of POST://stub/:resourceName/:id
Deletes a specific stub by identity for a particular named resource.
The output from Stubber.js will always be a JSON response that falls in to one of three specific response types. The three response types are detailed below.
{
root: "error",
error: {
// All of the details associated with the error will be placed here
}
}
{
root: <listingResourceName>,
<listingResourceName>: [
// array of resources
],
limit: //number of resources the result is limited to
offset: // offset of this block within the full result set
count: // total number of resources that were returned
length: // total number of resources that could have been returned
}
{
root: <resourceName>,
<resourceName>: {
// singular resource result
}
}
FAQs
Stubber.js a generic Resourcefully RESTful Stub API provider.
We found that stubber 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.