Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
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.
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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.