New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

class-with-resources

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

class-with-resources

A class that has resources specified on the webcomponents, stylesheets and scripts attributes. Loaded using the loadResources method.

latest
npmnpm
Version
0.0.4
Version published
Weekly downloads
24
140%
Maintainers
1
Weekly downloads
 
Created
Source

Cacher readme

Cacher is an NPM module that serves to cache a value received from a promise, it allows you to specify the lifespan of cached value (defaults to 2000ms), if the value is requested another time before the cache has 'died' the cached value will be returned.

When the Cacher is executed it first looks for a cached value using the arguments provided (same input => same output), if found, it returns the cache, if not found, it executes the async function and caches the value it resolves with and returns this value to the user.

Installing

Run npm install

Testing

Run npm test

Usage

The Cacher module gives you a class when imported, you can instantiate or extends this class to have the execute method, and optionally change the lifespan.

import Cacher from 'frntnd-cacher';

const cacher = new Cacher({
  lifespan: 3000,
  execute(...args) {
    return new Promise(resolve => {
      // some async stuff that returns with the value that should be cached.
      resolve(data);
    });
  }
});

FAQs

Package last updated on 07 Oct 2015

Did you know?

Socket

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.

Install

Related posts