{"name":"d3-fetch","version":"1.2.0","description":"Convenient parsing for Fetch.","keywords":["d3","d3-module","fetch","ajax","XMLHttpRequest"],"homepage":"https://d3js.org/d3-fetch/","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"http://bost.ocks.org/mike"},"main":"dist/d3-fetch.js","unpkg":"dist/d3-fetch.min.js","jsdelivr":"dist/d3-fetch.min.js","module":"src/index.js","repository":{"type":"git","url":"git+https://github.com/d3/d3-fetch.git"},"scripts":{"pretest":"rollup -c","test":"tape 'test/**/*-test.js' && eslint src","prepublishOnly":"rm -rf dist && yarn test","postpublish":"git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"},"dependencies":{"d3-dsv":"1"},"sideEffects":false,"devDependencies":{"eslint":"6","rollup":"1","rollup-plugin-terser":"5","tape":"4"},"gitHead":"2ea23c29a7e9ee30f513d5852dd91644b14a312d","bugs":{"url":"https://github.com/d3/d3-fetch/issues"},"_id":"d3-fetch@1.2.0","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-yC78NBVcd2zFAyR/HnUiBS7Lf6inSCoWcSxFfw8FYL7ydiqe80SazNwoffcqOfs95XaLo7yebsmQqDKSsXUtvA==","shasum":"15ce2ecfc41b092b1db50abd2c552c2316cf7fc7","tarball":"http://registry-npm.ywwl.com/d3-fetch/download/d3-fetch-1.2.0.tgz","fileCount":13,"unpackedSize":17027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe18OTCRA9TVsSAnZWagAA/KUP/irrUfxxAAezf12c7TX/\n8yXezaoYDb5RZ5UaEsWQFHNaF2+nWRO/gUgLWMQaOuXOfFw3CU+KPs88uMMZ\nE/xE6KwGawgVicEMOVvmmOL/aKp7yR04Wk0hvZg2WxiCOY9YgOjsne6mzfaH\ntQMdgRW8/PDZ73wHSD47pZBwajS+fZEls6hFO2whso7E8klzfGfJZxKUNcR9\njF+HDOJ0VW1mUTMOH+u3iLrG5pTxw8UZqeoPqc6IIfh2/+n54AuEEIWfHbmr\nqjgti/g7Jb2iGYSBNDeiKbMunG97tWWpGbVduvzHY1h2waDSMtq08dHzr2eA\nfuhmanPiLE6PsfRz2N98H20EY8v1crO0jq4AzZZ0s86UigvX98kqxSUNkEBB\nmyjwtQ7LIKVBCIxiUOpPvq0Ylcm8lj2Zcg8hhuQFIsBQRKhVYuh+uzs+a1Kn\n09M9iUX3lEcnR9jOplwdpN6DiAFk4299ilXcz5vY/0A06idOsAwXrymh52jB\nctQlemeQpXYvaBdt6Y9MIpPAIFc24iQ/7MSuTIVNmG3WZX1vqveX//A0YIWv\nsnwuRdCQU18Gf1Tk1ajMvjIn8iuwC9D+S13uq5ogMwfpOZ6/AW3AIfjOvwZQ\ndMGT+LFl33CbxPEpBBQEG0byjNSOIj17a+X2TBiLM+vCuPUy3qrd0osk+1Fn\nwAru\r\n=xzOd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBA+1YzA071arQR3r6r6zGhpu1Zl0v+Qu+dH8iXO3vSBAiAwjUxXEMv/ty1hOkx6ioMiXL25lOGZmO7olw7MJl1sYA=="}],"size":4923,"noattachment":false,"key":"/d3-fetch/-/d3-fetch-1.2.0.tgz"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d3-fetch_1.2.0_1591198610662_0.8338060020048736"},"_hasShrinkwrap":false,"readme":"# d3-fetch\n\nThis module provides convenient parsing on top of [Fetch](https://fetch.spec.whatwg.org/). For example, to load a text file:\n\n```js\nconst text = await d3.text(\"/path/to/file.txt\");\nconsole.log(text); // Hello, world!\n```\n\nTo load and parse a CSV file:\n\n```js\nconst data = await d3.csv(\"/path/to/file.csv\");\nconsole.log(data); // [{\"Hello\": \"world\"}, …]\n```\n\nThis module has built-in support for parsing [JSON](#json), [CSV](#csv), and [TSV](#tsv). You can parse additional formats by using [text](#text) directly. (This module replaced [d3-request](https://github.com/d3/d3-request).)\n\n## Installing\n\nIf you use npm, `npm install d3-fetch`. You can also download the [latest release on GitHub](https://github.com/d3/d3-fetch/releases/latest). For vanilla HTML in modern browsers, import d3-fetch from Skypack:\n\n```html\n<script type=\"module\">\n\nimport {csv} from \"https://cdn.skypack.dev/d3-fetch@3\";\n\ncsv(\"/path/to/file.csv\").then((data) => {\n  console.log(data); // [{\"Hello\": \"world\"}, …]\n});\n\n</script>\n```\n\nFor legacy environments, you can load d3-fetch’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported:\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/d3-fetch@3\"></script>\n<script>\n\nd3.csv(\"/path/to/file.csv\").then((data) => {\n  console.log(data); // [{\"Hello\": \"world\"}, …]\n});\n\n</script>\n```\n\n## API Reference\n\n<a name=\"blob\" href=\"#blob\">#</a> d3.<b>blob</b>(<i>input</i>[, <i>init</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/blob.js \"Source\")\n\nFetches the binary file at the specified *input* URL as a Blob. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.\n\n<a name=\"buffer\" href=\"#buffer\">#</a> d3.<b>buffer</b>(<i>input</i>[, <i>init</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/buffer.js \"Source\")\n\nFetches the binary file at the specified *input* URL as an ArrayBuffer. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.\n\n<a name=\"csv\" href=\"#csv\">#</a> d3.<b>csv</b>(<i>input</i>[, <i>init</i>][, <i>row</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/dsv.js \"Source\")\n\nEquivalent to [d3.dsv](#dsv) with the comma character as the delimiter.\n\n<a name=\"dsv\" href=\"#dsv\">#</a> d3.<b>dsv</b>(<i>delimiter</i>, <i>input</i>[, <i>init</i>][, <i>row</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/dsv.js \"Source\")\n\nFetches the [DSV](https://github.com/d3/d3-dsv) file at the specified *input* URL. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields. An optional *row* conversion function may be specified to map and filter row objects to a more-specific representation; see [*dsv*.parse](https://github.com/d3/d3-dsv#dsv_parse) for details. For example:\n\n```js\nconst data = await d3.dsv(\",\", \"test.csv\", (d) => {\n  return {\n    year: new Date(+d.Year, 0, 1), // convert \"Year\" column to Date\n    make: d.Make,\n    model: d.Model,\n    length: +d.Length // convert \"Length\" column to number\n  };\n});\n```\n\nIf only one of *init* and *row* is specified, it is interpreted as the *row* conversion function if it is a function, and otherwise an *init* object.\n\nSee also [d3.csv](#csv) and [d3.tsv](#tsv).\n\n<a name=\"html\" href=\"#html\">#</a> d3.<b>html</b>(<i>input</i>[, <i>init</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/xml.js \"Source\")\n\nFetches the file at the specified *input* URL as [text](#text) and then [parses it](https://developer.mozilla.org/docs/Web/API/DOMParser) as HTML. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.\n\n<a name=\"image\" href=\"#image\">#</a> d3.<b>image</b>(<i>input</i>[, <i>init</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/image.js \"Source\")\n\nFetches the image at the specified *input* URL. If *init* is specified, sets any additional properties on the image before loading. For example, to enable an anonymous [cross-origin request](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image):\n\n```js\nconst img = await d3.image(\"https://example.com/test.png\", {crossOrigin: \"anonymous\"});\n```\n\n<a name=\"json\" href=\"#json\">#</a> d3.<b>json</b>(<i>input</i>[, <i>init</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/json.js \"Source\")\n\nFetches the [JSON](http://json.org) file at the specified *input* URL. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields. If the server returns a status code of [204 No Content](https://developer.mozilla.org/docs/Web/HTTP/Status/204) or [205 Reset Content](https://developer.mozilla.org/docs/Web/HTTP/Status/205), the promise resolves to `undefined`.\n\n<a name=\"svg\" href=\"#svg\">#</a> d3.<b>svg</b>(<i>input</i>[, <i>init</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/xml.js \"Source\")\n\nFetches the file at the specified *input* URL as [text](#text) and then [parses it](https://developer.mozilla.org/docs/Web/API/DOMParser) as SVG. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.\n\n<a name=\"text\" href=\"#text\">#</a> d3.<b>text</b>(<i>input</i>[, <i>init</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/text.js \"Source\")\n\nFetches the text file at the specified *input* URL. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.\n\n<a name=\"tsv\" href=\"#tsv\">#</a> d3.<b>tsv</b>(<i>input</i>[, <i>init</i>][, <i>row</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/dsv.js \"Source\")\n\nEquivalent to [d3.dsv](#dsv) with the tab character as the delimiter.\n\n<a name=\"xml\" href=\"#xml\">#</a> d3.<b>xml</b>(<i>input</i>[, <i>init</i>]) · [Source](https://github.com/d3/d3-fetch/blob/master/src/xml.js \"Source\")\n\nFetches the file at the specified *input* URL as [text](#text) and then [parses it](https://developer.mozilla.org/docs/Web/API/DOMParser) as XML. If *init* is specified, it is passed along to the underlying call to [fetch](https://fetch.spec.whatwg.org/#fetch-method); see [RequestInit](https://fetch.spec.whatwg.org/#requestinit) for allowed fields.\n","publish_time":1591198610756,"_cnpm_publish_time":1591198610756,"dist-tags":{"latest":"3.0.2"}}