
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
http crud library for making web requests with promises
npm install pilou
import resource from 'pilou';
pilou(resourceName, [options])
exemple create clients resource
import resource from 'pilou';
const clients = resource('clients')
import resource from 'pilou';
const clients = resource('clients');
// GET /api/clients/
clients.all().then(response => {
console.log(response.data);
console.log(response.status);
});
// GET /api/clients/c8e4f983-8ffe-b705-4064-d3b7aa4a4782/
clients.get({id: 'c8e4f983-8ffe-b705-4064-d3b7aa4a4782'});
// POST /api/clients/ {name: 'client name'}
clients.create({name: 'client name'});
// PUT /api/clients/c8e4f983-4064-8ffe-b705-d3b7aa4a4782/
clients.update({id: 'c8e4f983-4064-8ffe-b705-d3b7aa4a4782'}, {name: 'updated name'});
// DELETE /api/clients/c8e4f983-4064-8ffe-b705-d3b7aa4a4782/
clients.delete({id: 'c8e4f983-8ffe-4064-b705-d3b7aa4a4782'});
const config = {
headers: {Authorization: `JWT ...`},
params: {date: '-created'}
};
// GET /api/clients/?date=-created
clients.all(config);
customize endpoints
const equipments = resource('equipments', {
all: '/api/v2/${resource}',
get: '/api/v2/${resource}/${equipmentId}'
});
// GET /api/v2/equipments
equipments.all();
// POST /api/v2/equipments {equipmentName: 'foo'}
equipments.create({equipmentName: 'foo'});
// GET /api/v2/equipments/42
equipments.get({equipmentId: 42});
// PUT /api/v2/equipments/42 {equipmentName: 'foo'}
equipments.update({equipmentId: 42}, {equipmentName: 'foo'});
customize every endpoints
const equipments = resource('equipments', {
all: '/api/all/${resource}/',
create: '/api/v2/${resource}',
get: '/api/get/${resource}/${id}/',
update: '/api/update/${resource}/${id}/',
delete: '/api/v2/${resource}/${id}'
});
These are the available config options for making requests.
{
// `url` is the server URL that will be used for the request
url: '/user',
// `baseURL` will be prepended to `url` unless `url` is absolute.
// It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
// to methods of that instance.
baseURL: 'https://some-domain.com/',
// `headers` are custom headers to be sent
headers: {'X-Requested-With': 'XMLHttpRequest'},
// `timeout` specifies the number of milliseconds before the request times out.
// If the request takes longer than `timeout`, the request will be aborted.
timeout: 1000,
// `auth` indicates that HTTP Basic auth should be used, and supplies credentials.
// This will set an `Authorization` header, overwriting any existing
// `Authorization` custom headers you have set using `headers`.
auth: {
username: 'admin',
password: 'password'
}
// `responseType` indicates the type of data that the server will respond with
// options are 'arraybuffer', 'blob', 'document', 'json', 'text', 'stream'
responseType: 'json', // default
// `xsrfCookieName` is the name of the cookie to use as a value for xsrf token
xsrfCookieName: 'XSRF-TOKEN', // default
// `xsrfHeaderName` is the name of the http header that carries the xsrf token value
xsrfHeaderName: 'X-XSRF-TOKEN', // default
// `maxContentLength` defines the max size of the http response content allowed
maxContentLength: 2000
}
MIT - see license file
FAQs
http crud library for making web requests with promises
We found that pilou 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.