{"library":"continuation-local-storage","type":"library","category":null,"description":"This package provides a userland implementation of Continuation-Local Storage (CLS) for Node.js, a mechanism akin to thread-local storage but adapted for Node's asynchronous callback chains. It allows developers to store and retrieve values that are scoped to the lifetime of a sequence of asynchronous function calls, eliminating the need to explicitly pass context objects (like request IDs or user information) through numerous function parameters. Values are managed within named 'namespaces' using `createNamespace()`, `getNamespace()`, and propagating context via `namespace.run()` or `namespace.bind()`. While a valuable concept, this specific `continuation-local-storage` package (version 3.2.1, last published 8 years ago) is considered superseded. Modern Node.js applications should leverage the native `AsyncLocalStorage` API (available since Node.js v13.10.0, backported to v12) for a more robust and performant solution, or `cls-hooked` for older Node.js versions, both of which utilize `async_hooks`.","language":"javascript","status":"abandoned","version":"3.2.1","tags":["javascript","threading","shared","context","domains","tracing","logging"],"last_verified":"Wed May 27","install":[{"cmd":"npm install continuation-local-storage","imports":["const createNamespace = require('continuation-local-storage').createNamespace;","const getNamespace = require('continuation-local-storage').getNamespace;","const cls = require('continuation-local-storage');\nconst session = cls.createNamespace('my session');"]},{"cmd":"yarn add continuation-local-storage","imports":[]},{"cmd":"pnpm add continuation-local-storage","imports":[]}],"homepage":null,"github":"https://github.com/othiym23/node-continuation-local-storage","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/continuation-local-storage","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/continuation-local-storage/compatibility"}}