New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@beetcb/tcb-conf

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beetcb/tcb-conf

store things at cloudbase function runtime

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

what the hack is tcb-conf?

tcb-conf is how you store conf at cloudbase function runtime,inspired by conf from @sindresorhus

You can also use it as a cloudbase function runtime's environment variables setter(beacause we store thing to there)

when to use it?

When you have a tiny piese of data(a secret-key, for example), tcb-conf stores it for you. Don't Worry: it will still be there next time you invoke that function

Inaccurately, tcb-conf cloud be alternative to a database (for storing tiny data)

Note: Only using it inside Client NodeJS, it's convenient!

how to use it?

const conf = require('@beetcb/tcb-conf')

// Make sure to use the async function, otherwise it will block the code execution
exports.main = async () => {
  // Init conf entity
  await conf.load()
  console.log(conf.get('secret') || conf.set('secret', 'xxx 🕊'))
}

conf.<method>:

  • get(key): get conf key's value
  • set(key, value): set conf key using value
  • getGlEnv(key): get global environment variable key's value
  • setGlEnv(key, value): set global environment variable key using value

how it works?

Under the hood, when the function is about to reach the timeout(about 10ms brfore timeout), tcb-conf starts to update the function's environment variables for next time invoking

Keywords

tcb

FAQs

Package last updated on 14 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts