{"_id":"istanbul-lib-processinfo","_rev":"2948368","name":"istanbul-lib-processinfo","description":"A utility for managing the `processinfo` folder that NYC uses.","dist-tags":{"latest":"2.0.3"},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"coreyfarrell","email":"git@cfware.com"},{"name":"isaacs","email":""}],"time":{"modified":"2023-04-26T08:53:19.000Z","created":"2019-04-15T16:51:36.961Z","2.0.3":"2022-06-02T18:34:04.911Z","2.0.2":"2019-10-08T00:20:21.919Z","2.0.1":"2019-10-07T03:26:37.936Z","2.0.0":"2019-06-21T10:07:27.564Z","1.0.0":"2019-04-15T16:51:36.961Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/istanbuljs/istanbul-lib-processinfo.git"},"versions":{"2.0.3":{"name":"istanbul-lib-processinfo","version":"2.0.3","description":"A utility for managing the `processinfo` folder that NYC uses.","main":"index.js","scripts":{"test":"tap","snap":"tap","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/istanbuljs/istanbul-lib-processinfo.git"},"license":"ISC","dependencies":{"archy":"^1.0.0","cross-spawn":"^7.0.3","istanbul-lib-coverage":"^3.2.0","p-map":"^3.0.0","rimraf":"^3.0.0","uuid":"^8.3.2"},"devDependencies":{"standard-version":"^7.0.0","tap":"^15.1.5","nyc":"^15.1.0"},"engines":{"node":">=8"},"tap":{"check-coverage":true,"jobs":1},"nyc":{"include":"index.js"},"gitHead":"b9cd52cf6eb140cf3bff24ba5df34d5812845d66","bugs":{"url":"https://github.com/istanbuljs/istanbul-lib-processinfo/issues"},"homepage":"https://github.com/istanbuljs/istanbul-lib-processinfo#readme","_id":"istanbul-lib-processinfo@2.0.3","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"shasum":"366d454cd0dcb7eb6e0e419378e60072c8626169","size":5717,"noattachment":false,"key":"/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/istanbul-lib-processinfo/download/istanbul-lib-processinfo-2.0.3.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"coreyfarrell","email":"git@cfware.com"},{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/istanbul-lib-processinfo_2.0.3_1654194844724_0.9510533002138928"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-05T12:34:14.312Z","publish_time":1654194844911,"_cnpm_publish_time":1654194844911},"2.0.2":{"name":"istanbul-lib-processinfo","version":"2.0.2","description":"A utility for managing the `processinfo` folder that NYC uses.","main":"index.js","scripts":{"test":"tap","snap":"tap","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/istanbuljs/istanbul-lib-processinfo.git"},"license":"ISC","dependencies":{"archy":"^1.0.0","cross-spawn":"^7.0.0","istanbul-lib-coverage":"^3.0.0-alpha.1","make-dir":"^3.0.0","p-map":"^3.0.0","rimraf":"^3.0.0","uuid":"^3.3.3"},"devDependencies":{"standard-version":"^7.0.0","tap":"^14.6.5","nyc":"^15.0.0-alpha.0"},"engines":{"node":">=8"},"tap":{"check-coverage":true,"jobs":1},"nyc":{"include":"index.js"},"readmeFilename":"README.md","gitHead":"5c356cd1a541c1b22a72a6ce5e09070386162dee","bugs":{"url":"https://github.com/istanbuljs/istanbul-lib-processinfo/issues"},"homepage":"https://github.com/istanbuljs/istanbul-lib-processinfo#readme","_id":"istanbul-lib-processinfo@2.0.2","_nodeVersion":"12.11.0","_npmVersion":"6.11.3","dist":{"shasum":"e1426514662244b2f25df728e8fd1ba35fe53b9c","size":6581,"noattachment":false,"key":"/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/istanbul-lib-processinfo/download/istanbul-lib-processinfo-2.0.2.tgz"},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"coreyfarrell","email":"git@cfware.com"},{"name":"isaacs","email":""}],"_npmUser":{"name":"coreyfarrell","email":"git@cfware.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/istanbul-lib-processinfo_2.0.2_1570494021789_0.2912939420150831"},"_hasShrinkwrap":false,"publish_time":1570494021919,"_cnpm_publish_time":1570494021919},"2.0.1":{"name":"istanbul-lib-processinfo","version":"2.0.1","description":"A utility for managing the `processinfo` folder that NYC uses.","main":"index.js","scripts":{"test":"tap","snap":"tap","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/istanbuljs/istanbul-lib-processinfo.git"},"license":"ISC","dependencies":{"archy":"^1.0.0","cross-spawn":"^7.0.0","istanbul-lib-coverage":"^3.0.0-alpha.1","make-dir":"^3.0.0","p-map":"^3.0.0","rimraf":"^3.0.0","uuid":"^3.3.3"},"devDependencies":{"standard-version":"^7.0.0","tap":"^14.6.5"},"engines":{"node":">=8"},"tap":{"check-coverage":true,"jobs":1},"nyc":{"include":"index.js"},"readmeFilename":"README.md","gitHead":"4cd2064f42c0718dc5a7076d4c11d3d946adca54","bugs":{"url":"https://github.com/istanbuljs/istanbul-lib-processinfo/issues"},"homepage":"https://github.com/istanbuljs/istanbul-lib-processinfo#readme","_id":"istanbul-lib-processinfo@2.0.1","_nodeVersion":"12.11.0","_npmVersion":"6.11.3","dist":{"shasum":"725d27a0003840cd1abea5e4f537d18bfc60c078","size":6563,"noattachment":false,"key":"/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/istanbul-lib-processinfo/download/istanbul-lib-processinfo-2.0.1.tgz"},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"coreyfarrell","email":"git@cfware.com"},{"name":"isaacs","email":""}],"_npmUser":{"name":"coreyfarrell","email":"git@cfware.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/istanbul-lib-processinfo_2.0.1_1570418797828_0.08468783774553357"},"_hasShrinkwrap":false,"publish_time":1570418797936,"_cnpm_publish_time":1570418797936},"2.0.0":{"name":"istanbul-lib-processinfo","version":"2.0.0","description":"A utility for managing the `processinfo` folder that NYC uses.","main":"index.js","scripts":{"test":"tap","snap":"tap","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/istanbuljs/istanbul-lib-processinfo.git"},"license":"ISC","dependencies":{"archy":"^1.0.0","cross-spawn":"^6.0.5","istanbul-lib-coverage":"^3.0.0-alpha.0","make-dir":"^3.0.0","rimraf":"^2.6.3","uuid":"^3.3.2"},"devDependencies":{"standard-version":"^6.0.1","tap":"^14.0.0"},"engines":{"node":">=8"},"tap":{"check-coverage":true,"jobs":1},"nyc":{"include":"index.js"},"readmeFilename":"README.md","gitHead":"c6cfcf6bfee8249223fb72d8b7465de1ce944c91","bugs":{"url":"https://github.com/istanbuljs/istanbul-lib-processinfo/issues"},"homepage":"https://github.com/istanbuljs/istanbul-lib-processinfo#readme","_id":"istanbul-lib-processinfo@2.0.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"shasum":"741143aab52239fb7bff173d66fd4ef502e1017d","size":6265,"noattachment":false,"key":"/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/istanbul-lib-processinfo/download/istanbul-lib-processinfo-2.0.0.tgz"},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"coreyfarrell","email":"git@cfware.com"},{"name":"isaacs","email":""}],"_npmUser":{"name":"coreyfarrell","email":"git@cfware.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/istanbul-lib-processinfo_2.0.0_1561111647445_0.821273276870774"},"_hasShrinkwrap":false,"publish_time":1561111647564,"_cnpm_publish_time":1561111647564},"1.0.0":{"name":"istanbul-lib-processinfo","version":"1.0.0","description":"A utility for managing the `processinfo` folder that NYC uses.","main":"index.js","scripts":{"test":"tap -j1","snap":"tap -j1","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --all; git push origin --tags"},"repository":{"type":"git","url":"git+https://github.com/istanbuljs/istanbul-lib-processinfo.git"},"license":"ISC","dependencies":{"archy":"^1.0.0","cross-spawn":"^6.0.5","istanbul-lib-coverage":"^2.0.3","rimraf":"^2.6.3","uuid":"^3.3.2"},"devDependencies":{"nyc":"^14.0.0-rc.1","tap":"^13.0.0-rc.23"},"tap":{"check-coverage":true},"nyc":{"include":"index.js"},"gitHead":"49c45fd49500c84870b727f50862e09b4f24ff7d","bugs":{"url":"https://github.com/istanbuljs/istanbul-lib-processinfo/issues"},"homepage":"https://github.com/istanbuljs/istanbul-lib-processinfo#readme","_id":"istanbul-lib-processinfo@1.0.0","_nodeVersion":"11.11.0","_npmVersion":"6.9.0","dist":{"shasum":"6c0b59411d2897313ea09165fd95464a32be5610","size":5749,"noattachment":false,"key":"/istanbul-lib-processinfo/-/istanbul-lib-processinfo-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/istanbul-lib-processinfo/download/istanbul-lib-processinfo-1.0.0.tgz"},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"coreyfarrell","email":"git@cfware.com"},{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/istanbul-lib-processinfo_1.0.0_1555347096786_0.17458002255784866"},"_hasShrinkwrap":false,"publish_time":1555347096961,"_cnpm_publish_time":1555347096961}},"readme":"# istanbul-lib-processinfo\n\nA utility for managing the `processinfo` folder that NYC uses.\n\nThis is intended to be used along with [NYC](https://npm.im/nyc), but can also\nbe used by other tools that wish to consume NYC's processinfo data.\n\n## API\n\n### class ProcessInfo\n\nA representation of information about a single process.\n\n#### constructor(fields)\n\nPass in fields that will be printed to the processinfo file.  Several defaults\nwill be provided if not specified.\n\n#### async processInfo.save()\n\nWrite this process info to disk.  This works by passing the ProcessInfo object\nto JSON.stringify, and writing to `${this.directory}/${this.uuid}.json`.\n\n#### processInfo.saveSync()\n\nThe synchronous version of `.save()`.\n\n#### async processInfo.getCoverageMap(nyc)\n\nGet a merged coverage map of the current process, as well as any child\nprocesses.  This should only be called during tree rendering, as it depends on\nchild nodes being present in the `nodes` array.\n\nThe `nyc` instance is required to load the report information and apply\nsourcemaps properly.\n\n### processInfo.label\n\nA read-only string for when archy prints the process tree.\n\n### processInfo.nodes\n\nA list of the child nodes used during tree rendering.\n\n### processInfo.directory\n\nIf a process will be saved, it must have a `directory` included\nin the list of fields.  This property is not saved to the processinfo file.\n\n## class ProcessDB\n\nA utility for interacting with the collection of ProcessInfo files in the\nprocessinfo folder.\n\n### constructor(directory)\n\nSupply the directory where processinfo files are found.  This should be the\nfull path, something like `${cwd}/.nyc_output/processinfo`.\n\n### processDB.directory\n\nA read-only property showing the directory where this object is working.\n\n### processDB.nodes\n\nA list of child ProcessInfo nodes used in tree printing.\n\n### processDB.label\n\nThe string `'nyc'`, used as the default root node in the archy tree rendering.\n\n### async processDB.writeIndex()\n\nCreate the `index.json` file in the processinfo folder, which is required for\ntree generation and expunging.\n\nWARNING: Index writing is non-atomic, and should not be performed by multiple\nprocesses.\n\n### async processDB.readIndex()\n\nRead and return the contents of the `index.json` file.  If the `index.json` is\nnot present or not valid, then it will attempt to generate one.\n\n### async processDB.readProcessInfos()\n\nRead all the data files in the processinfo folder, and return an object mapping\nthe file basename to the resulting object.  Used in tree generation.\n\n### async processDB.renderTree(nyc)\n\nRender the tree as a string using archy, suitable for printing to the terminal.\n\n### async processDB.buildProcessTree()\n\nBuild the hierarchical tree of nodes for tree rendering.  Populates the `nodes`\narray of this object and all `ProcessInfo` objects in the tree.\n\n### async processDB.getCoverageMap(nyc)\n\nUsed in tree rendering, to show the total coverage of all the processinfo files\nin the data folder.\n\n### async processDB.spawn(name, file, args, options)\n\nSpawn a child process with a unique name provided by the caller.  This name is\nstored as the `externalId` property in the child process's `ProcessInfo` data,\nand is tracked in the `externalIds` section of the index.\n\nNote that if the current process is not already wrapped by nyc, then you must\nprefix the spawned program with nyc, in order for this to take effect.  For\nexample, instead of `processDB.spawn('foo', 'node', ['foo.js'])`, you would run\n`processDB.spawn('foo', 'nyc', ['node', 'foo.js'])`.\n\nIf a process with that name already exists in the index, then it will be\nexpunged.\n\nUnlike `child_process.spawn` this function returns a Promise which resolves to\nthe `ChildProcess` object.\n\nWARNING: Calling `expunge` (which this method does) will result in the index\nbeing out of date.  It is the caller's responsibility to call\n`processDB.writeIndex()` when all named processes are completed.\n\n### async processDB.expunge(name)\n\nIf a process exists in the process info data folder with the specified name\n(ie, it had previously been run with `processDB.spawn(name, ...)`) then the\ncoverage and processinfo files for it and all of its children are removed.\n\nThis allows for a test harness to re-run or resume test suites, without\nspurious coverage results.\n\nWARNING: Calling `expunge` will result in the index being out of date.  It is\nthe caller's responsibility to call `processDB.writeIndex()` when all named\nprocesses are completed.\n\n## DATA STRUCTURES and FILES\n\nProcessInfo files MUST match the following structure:\n\n```\n{\n  \"uuid\": \"UUID of the process itself\",\n  \"parent\": \"UUID of the parent process, or null\",\n  \"pid\": Number,\n  \"ppid\": Number (pid of parent process),\n  \"argv\": Array<String>,\n  \"execArgv\": Array<String>,\n  \"cwd\": path,\n  \"time\": Number (timestamp in ms),\n  \"coverageFilename\": \"Path to NYC coverage info for this process\",\n  \"externalId\": \"The externally specified name for this process, or null\",\n}\n```\n\nThe index file is saved to `${this.directory}/index.json`.  It has\nthe following structure:\n\n```\n{\n  \"processes\": {\n    \"<uuid>\": {\n      \"parent\": \"parent uuid, or null\",\n      \"children\": [\"children\", \"uuids\", \"or empty array\"],\n      \"externalId\": \"externally specified name, if provided\"\n    },\n    ...\n  },\n  \"files\": {\n    \"/path/to/covered/file.js\": [\n      \"<uuids of processes that covered this file>\",\n      ...\n    ],\n    ...\n  },\n  \"externalIds\": {\n    \"externally specified name\": {\n      \"root\": \"<uuid of process run under this name>\",\n      \"children\": [\n        \"<uuids of all descendant processes from this point in the tree>\",\n        ...\n      ]\n    },\n    ...\n  }\n}\n```\n","_attachments":{},"homepage":"https://github.com/istanbuljs/istanbul-lib-processinfo#readme","bugs":{"url":"https://github.com/istanbuljs/istanbul-lib-processinfo/issues"},"license":"ISC"}