🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

hello-cls

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

hello-cls

A Node.js library that implements Continuation-Local Storage

1.0.2
Source
npm
Version published
Weekly downloads
510
6.25%
Maintainers
1
Weekly downloads
 
Created
Source

hello-cls

Version Build status Codecov JavaScript Style Guide

A Node.js library that implements Continuation-Local Storage for Node 10+

Install & Requirements

npm i hello-cls
or
yarn add hello-cls

How to use

const { namespace } = require('hello-cls')

const context = namespace.initContext()

// I can set a value to a given key on the namespace
namespace.set('beer', 🍺)

// I can get a value from the namespace
console.log(namespace.get('beer'))
// -> 🍺

context.close()

// I can't get a value from the namespace if the context is closed
console.log(namespace.get('beer'))
// -> null

Made with ❤️ at comet

Keywords

hello-cls

FAQs

Package last updated on 18 Jun 2019

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