Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
caching-client
Advanced tools
Example Caching Client (HTTP Client using the Cache API). This example cache any request that is made using the available functions.
Caching Client (HTTP Client using the Cache API).
constructor
: Doing new CachingClient
you can pass the following options:
cacheVersion
: Default 1currentCache
: Default 'read-through'jsonSchemaRelHeader
: Default 'rel='describedBy''jsonSchemaEnvelopType
: Default 'https://api.openteams.com/json-schema/Envelope'clearCache
: Removes any entry in the managed cache store.
clearUnknownCache
: Removes any entry in caches not being managed by the client.
Requests (GET
, OPTIONS
, POST
, PUT
, DELETE
): Each request can be used calling its respective function (i.e get(...)
, options(...)
, post(...)
, put(...)
, and delete(...)
).
The parameters for the available functions are:
url
: URL to fetch.body
: Content of the request (in the case of POST
or PUT
requests).options
: To add or override the options used to fetch the given URL (headers
, mode
, method
, etc.). It is a key-value object. Also you can add a json
option if you want to get the response JSON parsed body only i.e {json: true}
To build a lib to be used in the browser you can use npm run build:lib
this will create the index.js
file that can be used from an HTML file with a script tag like <script type="text/javascript" src="index.js"></script>
To use the package you need to install it from the source with something like npm install --save <path to source>
After that, you can use something like import CachingClient from 'caching-client'
To play with the caching client you can use the http-server
package:
npm install http-server -g
And under the demo
directory:
http-server -p 3000
To build the demo after doing changes to the source code you can run npm run build:demo
client = cachingClient.default()
await cachingClient.get("https://jsonplaceholder.typicode.com/users/1/todos", true)
.FAQs
Example Caching Client (HTTP Client using the Cache API). This example cache any request that is made using the available functions.
The npm package caching-client receives a total of 5 weekly downloads. As such, caching-client popularity was classified as not popular.
We found that caching-client 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.