npm

Need private packages and team management tools?Check out npm Orgs. »

localism

0.4.0 • Public • Published

Localism

Local development tools. Not for production, just to make you more PRODUCTIVE.

Installation

npm install -g localism
npm install --save localism

Getting Started

Just require the module, every method lives at the top level.

const { simpleCache } = require('localism');
 
const cacheFn = simpleCache({fn: myAsyncFunction });

Methods

simpleCache({fn, [transformFromFile, fileNameGenerator, cacheDirectoryPath, uuidFileName]})

Wraps a given method to create a cache that writes to the local file system. The huge local development advantage is the ability to read and review responses, while keeping the cache from relying on what's in memory.

// This is made for async functions
 
const cachedFn = simpleCache({fn: myAsyncFunction, cacheDirectoryPath: 'tmp/local/cache'});
 
const response = await cachedFn({red: 2, green: 6, blue: false});
 
// The above response will be saved to a file and then accessed from there on future calls

Contribution Guidelines

Fork the respository and install all the dependencies:

npm install

Make sure to run the unit tests (and lint) before committing. Obviously, add to the tests as you make changes:

npm run test

For watch:

npm run test:watch

install

npm i localism

Downloadsweekly downloads

5

version

0.4.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability