Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via pnpm

flat-cache 3.1.0

A stupidly simple key/value storage using files to persist some data
Package summary
Share
0
issues
2
licenses
9
ISC
7
MIT
Package created
26 Feb 2015
Version published
25 Aug 2023
Maintainers
1
Total deps
16
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
9 Packages, Including:
flatted@3.3.1
fs.realpath@1.0.0
glob@7.2.3
inflight@1.0.6
inherits@2.0.4
minimatch@3.1.2
once@1.4.0
rimraf@3.0.2
wrappy@1.0.2

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
7 Packages, Including:
balanced-match@1.0.2
brace-expansion@1.1.11
concat-map@0.0.1
flat-cache@3.1.0
json-buffer@3.0.1
keyv@4.5.4
path-is-absolute@1.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of flat-cache 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
flatted3.3.139.32 kBISC
prod
keyv4.5.48.42 kBMIT
prod
rimraf3.0.26.33 kBISC
prod

Visualizations

Frequently Asked Questions

What does flat-cache do?

Flat-cache is a remarkably simplistic yet effective key/value storage system that uses files to persist data. It works as an in-memory cache with optional disk persistence. The purpose of flat-cache is to deliver a straightforward and "dumb" storage system that can be used for various applications, from storing file sizes and modification times to managing simple key/value storage. This NPM package offers a range of features to manage your data cache including loading cache, setting keys, removing keys, saving changes, and clearing the cache entirely.

How do you use flat-cache?

Using flat-cache is a straightforward process involving a few simple functions. To install it, first, run npm i --save flat-cache in your terminal.

Below is a basic example of how to use flat-cache in your JavaScript code:

var flatCache = require('flat-cache')
// Load the cache
var cache = flatCache.load('cacheId');

// Set a key on the cache
cache.setKey('key', { foo: 'var' });

// Get a key from the cache
console.log(cache.getKey('key')) // Outputs: { foo: 'var' }

// Fetch the entire persisted object
console.log(cache.all()) // Outputs: { 'key': { foo: 'var' } }

// Remove a key
cache.removeKey('key');

// Save it to disk
cache.save();

Please note, it is essential that you save your changes using cache.save(), else no changes will be persisted.

Where are the flat-cache docs?

The flat-cache documentation can be found within the README content on the package's GitHub page. Visit https://github.com/jaredwray/flat-cache to view the various functions and usage examples of the flat-cache package. For a more in-depth guide to its functions, including more complex usage scenarios, refer to this documentation.