1.2.2 • Published 8 months ago

node-traceid v1.2.2

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

traceid

生成程序当前请求栈的id

安装

npm i node-traceid

直接生成traceid字符串

import Traceid from 'node-traceid';

const traceid = Traceid();

异步本地存储

import Traceid from 'node-traceid';
import store from 'node-traceid/dist/store';

store.init({ test: true }, () => {
    const traceid = store.get('traceid');
    // 当前调用栈的其它属性
    const test = store.get('test');
});

支持自定义traceid

import Traceid from 'node-traceid';
import store from 'node-traceid/dist/store';

store.init({ traceid: '123' }, () => {
    const traceid = store.get('traceid');
    // traceid === '123'
});
1.2.0

8 months ago

1.1.0

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.0.0

2 years ago