123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- {
- "_args": [
- [
- {
- "raw": "are-we-there-yet@~1.1.2",
- "scope": null,
- "escapedName": "are-we-there-yet",
- "name": "are-we-there-yet",
- "rawSpec": "~1.1.2",
- "spec": ">=1.1.2 <1.2.0",
- "type": "range"
- },
- "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/npmlog"
- ]
- ],
- "_from": "are-we-there-yet@>=1.1.2 <1.2.0",
- "_id": "are-we-there-yet@1.1.4",
- "_inCache": true,
- "_location": "/are-we-there-yet",
- "_nodeVersion": "7.7.4",
- "_npmOperationalInternal": {
- "host": "packages-18-east.internal.npmjs.com",
- "tmp": "tmp/are-we-there-yet-1.1.4.tgz_1492760790532_0.2543606413528323"
- },
- "_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
- },
- "_npmVersion": "4.5.0",
- "_phantomChildren": {
- "core-util-is": "1.0.2",
- "inherits": "2.0.3",
- "process-nextick-args": "1.0.7",
- "safe-buffer": "5.1.1",
- "util-deprecate": "1.0.2"
- },
- "_requested": {
- "raw": "are-we-there-yet@~1.1.2",
- "scope": null,
- "escapedName": "are-we-there-yet",
- "name": "are-we-there-yet",
- "rawSpec": "~1.1.2",
- "spec": ">=1.1.2 <1.2.0",
- "type": "range"
- },
- "_requiredBy": [
- "/npmlog"
- ],
- "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz",
- "_shasum": "bb5dca382bb94f05e15194373d16fd3ba1ca110d",
- "_shrinkwrap": null,
- "_spec": "are-we-there-yet@~1.1.2",
- "_where": "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/npmlog",
- "author": {
- "name": "Rebecca Turner",
- "url": "http://re-becca.org"
- },
- "bugs": {
- "url": "https://github.com/iarna/are-we-there-yet/issues"
- },
- "dependencies": {
- "delegates": "^1.0.0",
- "readable-stream": "^2.0.6"
- },
- "description": "Keep track of the overall completion of many disparate processes",
- "devDependencies": {
- "standard": "^6.0.8",
- "tap": "^5.7.0"
- },
- "directories": {},
- "dist": {
- "shasum": "bb5dca382bb94f05e15194373d16fd3ba1ca110d",
- "tarball": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz"
- },
- "files": [
- "index.js",
- "tracker-base.js",
- "tracker-group.js",
- "tracker-stream.js",
- "tracker.js",
- "CHANGES.md"
- ],
- "gitHead": "aea89b9c277c0674a2485a3eb94a7269bb2346be",
- "homepage": "https://github.com/iarna/are-we-there-yet",
- "license": "ISC",
- "main": "index.js",
- "maintainers": [
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "name": "are-we-there-yet",
- "optionalDependencies": {},
- "readme": "are-we-there-yet\n----------------\n\nTrack complex hiearchies of asynchronous task completion statuses. This is\nintended to give you a way of recording and reporting the progress of the big\nrecursive fan-out and gather type workflows that are so common in async.\n\nWhat you do with this completion data is up to you, but the most common use case is to\nfeed it to one of the many progress bar modules.\n\nMost progress bar modules include a rudamentary version of this, but my\nneeds were more complex.\n\nUsage\n=====\n\n```javascript\nvar TrackerGroup = require(\"are-we-there-yet\").TrackerGroup\n\nvar top = new TrackerGroup(\"program\")\n\nvar single = top.newItem(\"one thing\", 100)\nsingle.completeWork(20)\n\nconsole.log(top.completed()) // 0.2\n\nfs.stat(\"file\", function(er, stat) {\n if (er) throw er \n var stream = top.newStream(\"file\", stat.size)\n console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete\n // and 50% * 20% == 10%\n fs.createReadStream(\"file\").pipe(stream).on(\"data\", function (chunk) {\n // do stuff with chunk\n })\n top.on(\"change\", function (name) {\n // called each time a chunk is read from \"file\"\n // top.completed() will start at 0.1 and fill up to 0.6 as the file is read\n })\n})\n```\n\nShared Methods\n==============\n\n* var completed = tracker.completed()\n\nImplemented in: `Tracker`, `TrackerGroup`, `TrackerStream`\n\nReturns the ratio of completed work to work to be done. Range of 0 to 1.\n\n* tracker.finish()\n\nImplemented in: `Tracker`, `TrackerGroup`\n\nMarks the tracker as completed. With a TrackerGroup this marks all of its\ncomponents as completed.\n\nMarks all of the components of this tracker as finished, which in turn means\nthat `tracker.completed()` for this will now be 1.\n\nThis will result in one or more `change` events being emitted.\n\nEvents\n======\n\nAll tracker objects emit `change` events with the following arguments:\n\n```\nfunction (name, completed, tracker)\n```\n\n`name` is the name of the tracker that originally emitted the event,\nor if it didn't have one, the first containing tracker group that had one.\n\n`completed` is the percent complete (as returned by `tracker.completed()` method).\n\n`tracker` is the tracker object that you are listening for events on.\n\nTrackerGroup\n============\n\n* var tracker = new TrackerGroup(**name**)\n\n * **name** *(optional)* - The name of this tracker group, used in change\n notifications if the component updating didn't have a name. Defaults to undefined.\n\nCreates a new empty tracker aggregation group. These are trackers whose\ncompletion status is determined by the completion status of other trackers.\n\n* tracker.addUnit(**otherTracker**, **weight**)\n\n * **otherTracker** - Any of the other are-we-there-yet tracker objects\n * **weight** *(optional)* - The weight to give the tracker, defaults to 1.\n\nAdds the **otherTracker** to this aggregation group. The weight determines\nhow long you expect this tracker to take to complete in proportion to other\nunits. So for instance, if you add one tracker with a weight of 1 and\nanother with a weight of 2, you're saying the second will take twice as long\nto complete as the first. As such, the first will account for 33% of the\ncompletion of this tracker and the second will account for the other 67%.\n\nReturns **otherTracker**.\n\n* var subGroup = tracker.newGroup(**name**, **weight**)\n\nThe above is exactly equivalent to:\n\n```javascript\n var subGroup = tracker.addUnit(new TrackerGroup(name), weight)\n```\n\n* var subItem = tracker.newItem(**name**, **todo**, **weight**)\n\nThe above is exactly equivalent to:\n\n```javascript\n var subItem = tracker.addUnit(new Tracker(name, todo), weight)\n```\n\n* var subStream = tracker.newStream(**name**, **todo**, **weight**)\n\nThe above is exactly equivalent to:\n\n```javascript\n var subStream = tracker.addUnit(new TrackerStream(name, todo), weight)\n```\n\n* console.log( tracker.debug() )\n\nReturns a tree showing the completion of this tracker group and all of its\nchildren, including recursively entering all of the children.\n\nTracker\n=======\n\n* var tracker = new Tracker(**name**, **todo**)\n\n * **name** *(optional)* The name of this counter to report in change\n events. Defaults to undefined.\n * **todo** *(optional)* The amount of work todo (a number). Defaults to 0.\n\nOrdinarily these are constructed as a part of a tracker group (via\n`newItem`).\n\n* var completed = tracker.completed()\n\nReturns the ratio of completed work to work to be done. Range of 0 to 1. If\ntotal work to be done is 0 then it will return 0.\n\n* tracker.addWork(**todo**)\n\n * **todo** A number to add to the amount of work to be done.\n\nIncreases the amount of work to be done, thus decreasing the completion\npercentage. Triggers a `change` event.\n\n* tracker.completeWork(**completed**)\n\n * **completed** A number to add to the work complete\n\nIncrease the amount of work complete, thus increasing the completion percentage.\nWill never increase the work completed past the amount of work todo. That is,\npercentages > 100% are not allowed. Triggers a `change` event.\n\n* tracker.finish()\n\nMarks this tracker as finished, tracker.completed() will now be 1. Triggers\na `change` event.\n\nTrackerStream\n=============\n\n* var tracker = new TrackerStream(**name**, **size**, **options**)\n\n * **name** *(optional)* The name of this counter to report in change\n events. Defaults to undefined.\n * **size** *(optional)* The number of bytes being sent through this stream.\n * **options** *(optional)* A hash of stream options\n\nThe tracker stream object is a pass through stream that updates an internal\ntracker object each time a block passes through. It's intended to track\ndownloads, file extraction and other related activities. You use it by piping\nyour data source into it and then using it as your data source.\n\nIf your data has a length attribute then that's used as the amount of work\ncompleted when the chunk is passed through. If it does not (eg, object\nstreams) then each chunk counts as completing 1 unit of work, so your size\nshould be the total number of objects being streamed.\n\n* tracker.addWork(**todo**)\n\n * **todo** Increase the expected overall size by **todo** bytes.\n\nIncreases the amount of work to be done, thus decreasing the completion\npercentage. Triggers a `change` event.\n",
- "readmeFilename": "README.md",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/iarna/are-we-there-yet.git"
- },
- "scripts": {
- "test": "standard && tap test/*.js"
- },
- "version": "1.1.4"
- }
|