1.0.2 • Published 6 years ago

stacks-to-json-stack-tree v1.0.2

Weekly downloads
4
License
Apache 2.0
Repository
github
Last release
6 years ago

stacks-to-json-stack-tree

Convert dtrace/perf stack samples into a JSON tree

Installation

npm install stacks-to-json-stack-tree --save

Usage

var fs = require('fs')
var stacksToJsonStackTree = require('stacks-to-json-stack-tree')
var mapFrames = (frames, instance) => frames // mapFrames is optional
var convertAndCollectFromStream = stacksToJsonStackTree(mapFrames, function (err, json) {
  if (err) throw err
  console.log(json)
})

fs.createReadStream('path/to/stacks').pipe(convertAndCollectFromStream)

Dependencies

  • debug: small debugging utility
  • end-of-stream: Call a callback when a readable/writable/duplex stream has completed or failed.
  • through2: A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise

Dev Dependencies

None

License

Apache 2.0