1.0.2 • Published 7 months ago
keepo v1.0.2
Table of Contents
Features
- Decrypt and use .keep file
- Use and manage user secrets easier
Installation
npm install keepo
Usage
After installation Use the snippet blow the get a secret and manage errors:
import { get as keepo, constants } from "keepo";
keepo<T>("<key>")
.then((value) => {
// do stuff
})
.catch((reason) => {
if (reason.startsWith("<key>")) {
// the key was not found
} else if (reason === constants.nokeeperror) {
// no .keep file - local or global - was found
}
});
or just:
import { get as keepo } from "keepo";
async function my_async_function() {
const secret = await keepo<T>("key");
// do stuff
}