{
  "_id": "path-source",
  "maintainers": [
    {
      "name": "mbostock",
      "email": "mike@ocks.org"
    }
  ],
  "keywords": [
    "fetch",
    "stream",
    "reader"
  ],
  "dist-tags": {
    "latest": "0.1.3"
  },
  "author": {
    "name": "Mike Bostock",
    "url": "https://bost.ocks.org/mike"
  },
  "_rev": "9-011230359458fbe46d344670b458d6cb",
  "description": "Read files in Node, or fetch URLs in browser, as standard WhatWG streams.",
  "readme": "# path-source\n\nA [readable stream reader](https://streams.spec.whatwg.org/#readable-stream-reader) for reading files in Node or fetching URLs in browser. For example, to read a file in Node:\n\n```js\nvar path = require(\"path-source\");\n\npath(\"README.md\")\n  .then(function read(source) {\n    return source.read().then(result => {\n      if (result.done) return;\n      process.stdout.write(result.value);\n      return read(source);\n    });\n  })\n  .catch(error => console.error(error.stack));\n```\n\nSimilarly, to fetch a resource in a browser (requires [array-source](https://github.com/mbostock/array-source) if [streaming fetch](https://www.chromestatus.com/feature/5804334163951616) is not supported):\n\n```html\n<!DOCTYPE html>\n<script src=\"https://unpkg.com/array-source@0\"></script>\n<script src=\"https://unpkg.com/path-source@0\"></script>\n<script>\n\nsources.path(\"README.md\")\n  .then(function read(source) {\n    return source.read().then(result => {\n      if (result.done) return;\n      console.log(result.value);\n      return read(source);\n    });\n  })\n  .catch(error => console.error(error.stack));\n\n</script>\n```\n\n## API Reference\n\n<a name=\"path\" href=\"#path\">#</a> <b>path</b>(<i>path</i>[, <i>options</i>]) [<>](https://github.com/mbostock/path-source/blob/master/index.js \"Source\")\n\nIn Node, returns a Promise that yields a *source* for the file at the specified *path*; equivalent to [file-source](https://github.com/mbostock/file-source#file). In a browser, returns a Promise that yields a *source* for the resource at the specified *path* URL, using [streaming fetch](https://www.chromestatus.com/feature/5804334163951616) if available, and falling back to a [binary data](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data) [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest).\n\nIn Node, the following options are supported:\n\n* `highWaterMark` - the stream’s internal buffer size; defaults to 65,536\n\nIn a browser, no options are currently supported.\n\n<a name=\"source_read\" href=\"#source_read\">#</a> <i>source</i>.<b>read</b>() [<>](https://github.com/mbostock/stream-source/blob/master/read.js \"Source\")\n\nReturns a Promise for the next chunk of data from the underlying stream. The yielded result is an object with the following properties:\n\n* `value` - a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) (a [Buffer](https://nodejs.org/api/buffer.html)), or undefined if the stream ended\n* `done` - a boolean which is true if the stream ended\n\n<a name=\"source_cancel\" href=\"#source_cancel\">#</a> <i>source</i>.<b>cancel</b>() [<>](https://github.com/mbostock/slice-source/blob/master/cancel.js \"Source\")\n\nReturns a Promise which is resolved when the underlying stream has been destroyed.\n",
  "repository": {
    "type": "git",
    "url": "git+ssh://git@github.com/mbostock/path-source.git"
  },
  "bugs": {
    "url": "https://github.com/mbostock/path-source/issues"
  },
  "license": "BSD-3-Clause",
  "versions": {
    "0.0.1": {
      "name": "path-source",
      "version": "0.0.1",
      "description": "Read files in Node, or fetch URLs in browser, as standard WhatWG streams.",
      "keywords": [
        "fetch",
        "stream",
        "reader"
      ],
      "homepage": "https://github.com/mbostock/path-source",
      "license": "BSD-3-Clause",
      "author": {
        "name": "Mike Bostock",
        "url": "https://bost.ocks.org/mike"
      },
      "browser": "dist/path-source.js",
      "main": "index.node.js",
      "module": "index.js",
      "repository": {
        "type": "git",
        "url": "git+ssh://git@github.com/mbostock/path-source.git"
      },
      "scripts": {
        "prepublish": "rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -g array-source:sources.array -n sources.path -o dist/path-source.js -- index.js && uglifyjs --preamble \"$(preamble)\" -o dist/path-source.min.js -cm -- dist/path-source.js",
        "postpublish": "git push && git push --tags"
      },
      "devDependencies": {
        "package-preamble": "0.0",
        "rollup": "0.34",
        "uglify-js": "2"
      },
      "dependencies": {
        "array-source": "0.0",
        "file-source": "0.5"
      },
      "gitHead": "ecfbbdab341710c0bbcdd13ee3ecc8e282ecdec5",
      "bugs": {
        "url": "https://github.com/mbostock/path-source/issues"
      },
      "_id": "path-source@0.0.1",
      "_shasum": "26dd2c164d7eaf2222fa81c132ab6c4195c1fc96",
      "_from": ".",
      "_npmVersion": "3.10.3",
      "_nodeVersion": "6.3.1",
      "_npmUser": {
        "name": "mbostock",
        "email": "mbostock@gmail.com"
      },
      "maintainers": [
        {
          "name": "mbostock",
          "email": "mbostock@gmail.com"
        }
      ],
      "dist": {
        "shasum": "26dd2c164d7eaf2222fa81c132ab6c4195c1fc96",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/path-source/-/path-source-0.0.1.tgz",
        "integrity": "sha512-rcHSL6rKUCTjtVZy+9/i/YLloWEo5rcoV1ZuPmzqNCRfyuUPICNew1N6bN9zXqVIR6X869Oty33gc405sAe2bQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIA5S5ZB/Sr+djOFOX3wgQnbj9Qg/AyKoWY57Llo683/bAiAlGeJ1Smn0+A/zxR6hmq4eA41sBeRu9q7GinO19wIArg=="
          }
        ]
      },
      "_npmOperationalInternal": {
        "host": "packages-12-west.internal.npmjs.com",
        "tmp": "tmp/path-source-0.0.1.tgz_1473196482372_0.946271708002314"
      }
    },
    "0.0.2": {
      "name": "path-source",
      "version": "0.0.2",
      "description": "Read files in Node, or fetch URLs in browser, as standard WhatWG streams.",
      "keywords": [
        "fetch",
        "stream",
        "reader"
      ],
      "homepage": "https://github.com/mbostock/path-source",
      "license": "BSD-3-Clause",
      "author": {
        "name": "Mike Bostock",
        "url": "https://bost.ocks.org/mike"
      },
      "browser": "dist/path-source.js",
      "main": "index.node.js",
      "module": "index.js",
      "repository": {
        "type": "git",
        "url": "git+ssh://git@github.com/mbostock/path-source.git"
      },
      "scripts": {
        "prepublish": "rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -g array-source:sources.array,slice-source:sources.slice -n sources.path -o dist/path-source.js -- index.js && uglifyjs --preamble \"$(preamble)\" -o dist/path-source.min.js -cm -- dist/path-source.js",
        "postpublish": "git push && git push --tags"
      },
      "devDependencies": {
        "package-preamble": "0.0",
        "rollup": "0.34",
        "uglify-js": "2"
      },
      "dependencies": {
        "array-source": "0.0",
        "file-source": "0.5",
        "slice-source": "0.3"
      },
      "gitHead": "7b473040812c45db51c95a1ea6605a333ba746b7",
      "bugs": {
        "url": "https://github.com/mbostock/path-source/issues"
      },
      "_id": "path-source@0.0.2",
      "_shasum": "a9b0ba1355074a2e8b02ed7af1a3b2b06a874b82",
      "_from": ".",
      "_npmVersion": "3.10.3",
      "_nodeVersion": "6.3.1",
      "_npmUser": {
        "name": "mbostock",
        "email": "mbostock@gmail.com"
      },
      "maintainers": [
        {
          "name": "mbostock",
          "email": "mike@ocks.org"
        }
      ],
      "dist": {
        "shasum": "a9b0ba1355074a2e8b02ed7af1a3b2b06a874b82",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/path-source/-/path-source-0.0.2.tgz",
        "integrity": "sha512-9LKZU+AD/VfwhJOAJDnCEM7O12vUk3h8DTqu2D1wfSL4P4eAG3GsWNXH2Z5yNCZNAy2nqN+wJO4bW0GO8//0wQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQDrWSJ/NP2tA0UixCBEZP+BghJBjBcUSe4Wj3FNoXxvDgIgRNvN+aCSNsCXUQOnrPjZCnh80yw1e36pfirNsOODlSs="
          }
        ]
      },
      "_npmOperationalInternal": {
        "host": "packages-16-east.internal.npmjs.com",
        "tmp": "tmp/path-source-0.0.2.tgz_1473203728594_0.4285888886079192"
      }
    },
    "0.1.0": {
      "name": "path-source",
      "version": "0.1.0",
      "description": "Read files in Node, or fetch URLs in browser, as standard WhatWG streams.",
      "keywords": [
        "fetch",
        "stream",
        "reader"
      ],
      "homepage": "https://github.com/mbostock/path-source",
      "license": "BSD-3-Clause",
      "author": {
        "name": "Mike Bostock",
        "url": "https://bost.ocks.org/mike"
      },
      "browser": "dist/path-source.js",
      "main": "index.node.js",
      "module": "index.js",
      "repository": {
        "type": "git",
        "url": "git+ssh://git@github.com/mbostock/path-source.git"
      },
      "scripts": {
        "prepublish": "rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -g array-source:sources.array -n sources.path -o dist/path-source.js -- index.js && uglifyjs --preamble \"$(preamble)\" -o dist/path-source.min.js -cm -- dist/path-source.js",
        "postpublish": "git push && git push --tags"
      },
      "dependencies": {
        "array-source": "0.0",
        "file-source": "0.6"
      },
      "devDependencies": {
        "package-preamble": "0.0",
        "rollup": "0.34",
        "uglify-js": "2"
      },
      "gitHead": "ce12b1e9d9c1ca7f9710f98aadec7e05af42d9f3",
      "bugs": {
        "url": "https://github.com/mbostock/path-source/issues"
      },
      "_id": "path-source@0.1.0",
      "_shasum": "d36e26f58fb12af2e44c3ba951501abf19253261",
      "_from": ".",
      "_npmVersion": "3.10.3",
      "_nodeVersion": "6.3.1",
      "_npmUser": {
        "name": "mbostock",
        "email": "mbostock@gmail.com"
      },
      "maintainers": [
        {
          "name": "mbostock",
          "email": "mike@ocks.org"
        }
      ],
      "dist": {
        "shasum": "d36e26f58fb12af2e44c3ba951501abf19253261",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/path-source/-/path-source-0.1.0.tgz",
        "integrity": "sha512-kA8M0Zgzsyrk1lWX05O0DZQXWNa7tnFXvykH17zs3m3Q/EJPVsF5DBIX1vSIaCk84oiAwcnUgmflr3CJXSMaBQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIDUYTNstSV81M9avrFnDWRdvXvvDECMFkqGB48PfAjHJAiBbMucQFPnLrvUx88mCOC9uZJUm2YbUYTJ2dKxo+8Nu3A=="
          }
        ]
      },
      "_npmOperationalInternal": {
        "host": "packages-12-west.internal.npmjs.com",
        "tmp": "tmp/path-source-0.1.0.tgz_1473269465413_0.19910506112501025"
      }
    },
    "0.1.1": {
      "name": "path-source",
      "version": "0.1.1",
      "description": "Read files in Node, or fetch URLs in browser, as standard WhatWG streams.",
      "keywords": [
        "fetch",
        "stream",
        "reader"
      ],
      "homepage": "https://github.com/mbostock/path-source",
      "license": "BSD-3-Clause",
      "author": {
        "name": "Mike Bostock",
        "url": "https://bost.ocks.org/mike"
      },
      "browser": "dist/path-source.js",
      "main": "index.node.js",
      "module": "index.js",
      "repository": {
        "type": "git",
        "url": "git+ssh://git@github.com/mbostock/path-source.git"
      },
      "scripts": {
        "prepublish": "rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -g array-source:sources.array -n sources.path -o dist/path-source.js -- index.js && uglifyjs --preamble \"$(preamble)\" -o dist/path-source.min.js -cm -- dist/path-source.js",
        "postpublish": "git push && git push --tags"
      },
      "dependencies": {
        "array-source": "0.0",
        "file-source": "0.6"
      },
      "devDependencies": {
        "package-preamble": "0.0",
        "rollup": "0.34",
        "uglify-js": "2"
      },
      "gitHead": "090ac8e4237242b3636e790d9bfe5da6699c6cdd",
      "bugs": {
        "url": "https://github.com/mbostock/path-source/issues"
      },
      "_id": "path-source@0.1.1",
      "_shasum": "c9a3389d7cb4417128d4fc7de805dc3c849e94d4",
      "_from": ".",
      "_npmVersion": "3.10.3",
      "_nodeVersion": "6.3.1",
      "_npmUser": {
        "name": "mbostock",
        "email": "mbostock@gmail.com"
      },
      "maintainers": [
        {
          "name": "mbostock",
          "email": "mike@ocks.org"
        }
      ],
      "dist": {
        "shasum": "c9a3389d7cb4417128d4fc7de805dc3c849e94d4",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/path-source/-/path-source-0.1.1.tgz",
        "integrity": "sha512-0EM90M/rKRuql/vADHZBxw9YiFJsUC0r/bVmXcXtBEtE8aKCZDZ+xM+coVT+lgeUAsj+xIt8wQoxi+riAm+vxQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIHqQxi8vzCLGtfhSR2dUlJ8P8Eh3gRrjADFXS6ZlyYw4AiBfwkafVHqUtBtgPhf94BJIY90wZTubyD8jIGhQEE1p/w=="
          }
        ]
      },
      "_npmOperationalInternal": {
        "host": "packages-16-east.internal.npmjs.com",
        "tmp": "tmp/path-source-0.1.1.tgz_1473286040785_0.7509122078772634"
      }
    },
    "0.1.2": {
      "name": "path-source",
      "version": "0.1.2",
      "description": "Read files in Node, or fetch URLs in browser, as standard WhatWG streams.",
      "keywords": [
        "fetch",
        "stream",
        "reader"
      ],
      "homepage": "https://github.com/mbostock/path-source",
      "license": "BSD-3-Clause",
      "author": {
        "name": "Mike Bostock",
        "url": "https://bost.ocks.org/mike"
      },
      "browser": "dist/path-source.js",
      "main": "index.node.js",
      "module": "index.js",
      "repository": {
        "type": "git",
        "url": "git+ssh://git@github.com/mbostock/path-source.git"
      },
      "scripts": {
        "prepublish": "rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -g array-source:sources.array -n sources.path -o dist/path-source.js -- index.js && uglifyjs --preamble \"$(preamble)\" -o dist/path-source.min.js -cm -- dist/path-source.js",
        "postpublish": "git push && git push --tags"
      },
      "dependencies": {
        "array-source": "0.0",
        "file-source": "0.6"
      },
      "devDependencies": {
        "package-preamble": "0.0",
        "rollup": "0.34",
        "uglify-js": "2"
      },
      "gitHead": "9e7cdf9726d0eeb39f2704db32e56fbdfc10470b",
      "bugs": {
        "url": "https://github.com/mbostock/path-source/issues"
      },
      "_id": "path-source@0.1.2",
      "_shasum": "c5a26c44fb92cd32b930e8e49b1fe5750f2ca70b",
      "_from": ".",
      "_npmVersion": "3.10.3",
      "_nodeVersion": "6.3.1",
      "_npmUser": {
        "name": "mbostock",
        "email": "mbostock@gmail.com"
      },
      "maintainers": [
        {
          "name": "mbostock",
          "email": "mike@ocks.org"
        }
      ],
      "dist": {
        "shasum": "c5a26c44fb92cd32b930e8e49b1fe5750f2ca70b",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/path-source/-/path-source-0.1.2.tgz",
        "integrity": "sha512-lTWxZqSX8rGekAWESIKfTjkn5yDtmsE6+mgbihQ3/4mk8QErd7EomR+bP62X9PnfXM01/2EIY7CQcKTOVJenbA==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEYCIQDLUrXXEsjcsa/zi2bFZBmQfd10tuAM6QSyJuD+8KOoQAIhAO6h4AohCs+uuSqslWO0tOHshszhkGy7xk5m7RjgbtcX"
          }
        ]
      },
      "_npmOperationalInternal": {
        "host": "packages-12-west.internal.npmjs.com",
        "tmp": "tmp/path-source-0.1.2.tgz_1473290949729_0.9380144476890564"
      }
    },
    "0.1.3": {
      "name": "path-source",
      "version": "0.1.3",
      "description": "Read files in Node, or fetch URLs in browser, as standard WhatWG streams.",
      "keywords": [
        "fetch",
        "stream",
        "reader"
      ],
      "homepage": "https://github.com/mbostock/path-source",
      "license": "BSD-3-Clause",
      "author": {
        "name": "Mike Bostock",
        "url": "https://bost.ocks.org/mike"
      },
      "unpkg": "dist/path-source.js",
      "jsdelivr": "dist/path-source.js",
      "main": "index.node.js",
      "module": "index.js",
      "repository": {
        "type": "git",
        "url": "git+ssh://git@github.com/mbostock/path-source.git"
      },
      "scripts": {
        "prepublishOnly": "rm -rf dist && mkdir dist && rollup -c --banner \"$(preamble)\" && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" -o dist/path-source.min.js -c -m -- dist/path-source.js",
        "postpublish": "git push && git push --tags"
      },
      "dependencies": {
        "array-source": "0.0",
        "file-source": "0.6"
      },
      "devDependencies": {
        "package-preamble": "0.1",
        "rollup": "0.49",
        "uglify-js": "3"
      },
      "gitHead": "be74516a063fac30bc2c98813a050603dc6111a7",
      "bugs": {
        "url": "https://github.com/mbostock/path-source/issues"
      },
      "_id": "path-source@0.1.3",
      "_npmVersion": "5.3.0",
      "_nodeVersion": "8.4.0",
      "_npmUser": {
        "name": "mbostock",
        "email": "mike@ocks.org"
      },
      "dist": {
        "integrity": "sha512-dWRHm5mIw5kw0cs3QZLNmpUWty48f5+5v9nWD2dw3Y0Hf+s01Ag8iJEWV0Sm0kocE8kK27DrIowha03e1YR+Qw==",
        "shasum": "03907c595480aa2596a15a901c44f745736e7a73",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/path-source/-/path-source-0.1.3.tgz",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIBB3dvq6ZXwilcCRFze4pNDWVFkPnx+HVDk/x0VEwhPCAiEArzQaSBuZaf5ayaZQpI+Bv1sxCyX48QfqLqvlKwxcEvs="
          }
        ]
      },
      "maintainers": [
        {
          "name": "mbostock",
          "email": "mike@ocks.org"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/path-source-0.1.3.tgz_1504389965691_0.7300573014654219"
      }
    }
  },
  "name": "path-source",
  "time": {
    "modified": "2026-05-22T22:15:16.536Z",
    "created": "2016-09-06T21:14:42.607Z",
    "0.0.1": "2016-09-06T21:14:42.607Z",
    "0.0.2": "2016-09-06T23:15:30.569Z",
    "0.1.0": "2016-09-07T17:31:05.644Z",
    "0.1.1": "2016-09-07T22:07:23.220Z",
    "0.1.2": "2016-09-07T23:29:09.979Z",
    "0.1.3": "2017-09-02T22:06:05.776Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/mbostock/path-source"
}