npm.io
1.0.7 • Published 6 years ago

gj-state

Licence
ISC
Version
1.0.7
Deps
0
Size
4 kB
Vulns
0
Weekly
0

gj-state

Installation

In order to add this package to your service, make sure you are logged in to your npm account. Inside your project folder run the following command:

npm i gs-state

API

Input:


    mode: 'serverless' | 'none' // default serverless
    filePath: String | false  // default false

Output:

{
    read(projectRoot: String),
    remove(projectRoot: String),
    write(projectRoot: String)
}

Usage 2

const setupState = require('gj-state')
const state = setupFs()

const main = async () => {
    await state.write(__dirname, {
        data: 'something'
    })

    const data = await state.read(__dirname)
    await state.remove(__dirname)
   
}