GithubHelp home page GithubHelp logo

sstore's Introduction

npm

What the hack is sstore?

serverless-store is how you store tiny things at serverless function runtime temporarily,inspired by conf.

When to use it?

When you have a tiny piese of data(an expiring access-token, for example), sstore stores it for you to path /temp/conf/${md5('conf.json').

Better yet, sstore won't block any code execution during runtime.

How to use it?

const sstore = require('@beetcb/sstore')

exports.main = () => {
  // If `secret` is undefind, set it
  console.log(sstore.get('secret') || sstore.set('secret', 'xxx 🕊'))
  // Code logic is done, starts storing,
  sstore.close()
}

sstore.<method>:

  • get(key): get key's value
  • set(key, value): set key using value
  • del(key): delete key's value
  • clear(): delete all the key value pairs
  • close(): This is where the sstore really starts to store

sstore's People

Contributors

beetcb avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sstore's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.