2.0.5 • Published 4 years ago

ccr v2.0.5

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

CCR

NPM Version NPM Downloads NPM License Install Size

Install

npm install ccr --save

Usage

const cache = require('ccr')('test_cache');
// aes: aes key or aesid obj

cache.file('userid').then(file => {
    // mkdirp paths auto
    console.log(file);
    // print /tmp/node-ccr/test_cache/2018/0523/15929_0148/userid_1

    const sid = cache.filekey(file, 'userid');
    // print S1Agc3os25Nynh4uI2tl5ZNOlBN7yUU1PvF1RTUJ5WsGHzDoPE9RdgAZbKvvr7EP
    console.log(cache.filekey(sid, 'userid'));
    // print /tmp/node-ccr/test_cache/2018/0523/15929_0148/userid_1

    // .... write content into file ....

    // encrypt file
    return cache.mvEncryptFile(sid, 'userid')
        // read encrypt file
        .then(() => cache.readEncryptFile(sid, 'userid'))
        // or use read stream
        .then(() => cache.createReadEncryptFileStream(sid, 'userid'));
});
2.0.5

4 years ago

0.1.2

4 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

6 years ago

0.1.1

7 years ago

0.1.0

7 years ago