Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-request

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-request - npm Package Compare versions

Comparing version 0.4.5 to 0.4.6

bin/rollup-node

2

build/d3-request.js

@@ -7,3 +7,3 @@ (function (global, factory) {

var version = "0.4.5";
var version = "0.4.6";

@@ -10,0 +10,0 @@ function request(url, callback) {

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-collection"),require("d3-dispatch"),require("d3-dsv")):"function"==typeof define&&define.amd?define(["exports","d3-collection","d3-dispatch","d3-dsv"],n):n(e.d3_request=e.d3_request||{},e.d3_collection,e.d3_dispatch,e.d3_dsv)}(this,function(e,n,t,r){"use strict";function o(e,r){function o(e){var n,t=d.status;if(!t&&s(d)||t>=200&&300>t||304===t){if(c)try{n=c.call(l,d)}catch(r){return void p.call("error",l,r)}else n=d;p.call("load",l,n)}else p.call("error",l,e)}var l,i,c,a,p=t.dispatch("beforesend","progress","load","error"),f=n.map(),d=new XMLHttpRequest,h=null,m=null,v=0;return"undefined"==typeof XDomainRequest||"withCredentials"in d||!/^(http(s)?:)?\/\//.test(e)||(d=new XDomainRequest),"onload"in d?d.onload=d.onerror=d.ontimeout=o:d.onreadystatechange=function(e){d.readyState>3&&o(e)},d.onprogress=function(e){p.call("progress",l,e)},l={header:function(e,n){return e=(e+"").toLowerCase(),arguments.length<2?f.get(e):(null==n?f.remove(e):f.set(e,n+""),l)},mimeType:function(e){return arguments.length?(i=null==e?null:e+"",l):i},responseType:function(e){return arguments.length?(a=e,l):a},timeout:function(e){return arguments.length?(v=+e,l):v},user:function(e){return arguments.length<1?h:(h=null==e?null:e+"",l)},password:function(e){return arguments.length<1?m:(m=null==e?null:e+"",l)},response:function(e){return c=e,l},get:function(e,n){return l.send("GET",e,n)},post:function(e,n){return l.send("POST",e,n)},send:function(n,t,r){return r||"function"!=typeof t||(r=t,t=null),r&&1===r.length&&(r=u(r)),d.open(n,e,!0,h,m),null==i||f.has("accept")||f.set("accept",i+",*/*"),d.setRequestHeader&&f.each(function(e,n){d.setRequestHeader(n,e)}),null!=i&&d.overrideMimeType&&d.overrideMimeType(i),null!=a&&(d.responseType=a),v>0&&(d.timeout=v),r&&l.on("error",r).on("load",function(e){r(null,e)}),p.call("beforesend",l,d),d.send(null==t?null:t),l},abort:function(){return d.abort(),l},on:function(){var e=p.on.apply(p,arguments);return e===p?l:e}},r?l.get(r):l}function u(e){return function(n,t){e(null==n?t:null)}}function s(e){var n=e.responseType;return n&&"text"!==n?e.response:e.responseText}function l(e,n){return function(t,r){var u=o(t).mimeType(e).response(n);return r?u.get(r):u}}function i(e,n){return function(t,r,u){arguments.length<3&&(u=r,r=null);var s=o(t).mimeType(e);return s.row=function(e){return arguments.length?s.response(c(n,r=e)):r},s.row(r),u?s.get(u):s}}function c(e,n){return function(t){return e(t.responseText,n)}}var a="0.4.5",p=l("text/html",function(e){return document.createRange().createContextualFragment(e.responseText)}),f=l("application/json",function(e){return JSON.parse(e.responseText)}),d=l("text/plain",function(e){return e.responseText}),h=l("application/xml",function(e){var n=e.responseXML;if(!n)throw new Error("parse error");return n}),m=i("text/csv",r.csvParse),v=i("text/tab-separated-values",r.tsvParse);e.version=a,e.request=o,e.html=p,e.json=f,e.text=d,e.xml=h,e.csv=m,e.tsv=v});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-collection"),require("d3-dispatch"),require("d3-dsv")):"function"==typeof define&&define.amd?define(["exports","d3-collection","d3-dispatch","d3-dsv"],n):n(e.d3_request=e.d3_request||{},e.d3_collection,e.d3_dispatch,e.d3_dsv)}(this,function(e,n,t,r){"use strict";function o(e,r){function o(e){var n,t=d.status;if(!t&&s(d)||t>=200&&300>t||304===t){if(c)try{n=c.call(l,d)}catch(r){return void p.call("error",l,r)}else n=d;p.call("load",l,n)}else p.call("error",l,e)}var l,i,c,a,p=t.dispatch("beforesend","progress","load","error"),f=n.map(),d=new XMLHttpRequest,h=null,m=null,v=0;return"undefined"==typeof XDomainRequest||"withCredentials"in d||!/^(http(s)?:)?\/\//.test(e)||(d=new XDomainRequest),"onload"in d?d.onload=d.onerror=d.ontimeout=o:d.onreadystatechange=function(e){d.readyState>3&&o(e)},d.onprogress=function(e){p.call("progress",l,e)},l={header:function(e,n){return e=(e+"").toLowerCase(),arguments.length<2?f.get(e):(null==n?f.remove(e):f.set(e,n+""),l)},mimeType:function(e){return arguments.length?(i=null==e?null:e+"",l):i},responseType:function(e){return arguments.length?(a=e,l):a},timeout:function(e){return arguments.length?(v=+e,l):v},user:function(e){return arguments.length<1?h:(h=null==e?null:e+"",l)},password:function(e){return arguments.length<1?m:(m=null==e?null:e+"",l)},response:function(e){return c=e,l},get:function(e,n){return l.send("GET",e,n)},post:function(e,n){return l.send("POST",e,n)},send:function(n,t,r){return r||"function"!=typeof t||(r=t,t=null),r&&1===r.length&&(r=u(r)),d.open(n,e,!0,h,m),null==i||f.has("accept")||f.set("accept",i+",*/*"),d.setRequestHeader&&f.each(function(e,n){d.setRequestHeader(n,e)}),null!=i&&d.overrideMimeType&&d.overrideMimeType(i),null!=a&&(d.responseType=a),v>0&&(d.timeout=v),r&&l.on("error",r).on("load",function(e){r(null,e)}),p.call("beforesend",l,d),d.send(null==t?null:t),l},abort:function(){return d.abort(),l},on:function(){var e=p.on.apply(p,arguments);return e===p?l:e}},r?l.get(r):l}function u(e){return function(n,t){e(null==n?t:null)}}function s(e){var n=e.responseType;return n&&"text"!==n?e.response:e.responseText}function l(e,n){return function(t,r){var u=o(t).mimeType(e).response(n);return r?u.get(r):u}}function i(e,n){return function(t,r,u){arguments.length<3&&(u=r,r=null);var s=o(t).mimeType(e);return s.row=function(e){return arguments.length?s.response(c(n,r=e)):r},s.row(r),u?s.get(u):s}}function c(e,n){return function(t){return e(t.responseText,n)}}var a="0.4.6",p=l("text/html",function(e){return document.createRange().createContextualFragment(e.responseText)}),f=l("application/json",function(e){return JSON.parse(e.responseText)}),d=l("text/plain",function(e){return e.responseText}),h=l("application/xml",function(e){var n=e.responseXML;if(!n)throw new Error("parse error");return n}),m=i("text/csv",r.csvParse),v=i("text/tab-separated-values",r.tsvParse);e.version=a,e.request=o,e.html=p,e.json=f,e.text=d,e.xml=h,e.csv=m,e.tsv=v});
'use strict';
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var d3Collection = require('d3-collection');

@@ -8,3 +9,3 @@ var d3Dispatch = require('d3-dispatch');

var version = "0.4.5";
var version = "0.4.6";

@@ -11,0 +12,0 @@ function request(url, callback) {

@@ -1,2 +0,2 @@

export {version} from "./build/version";
export {version} from "./build/package";
export {default as request} from "./src/request";

@@ -3,0 +3,0 @@ export {default as html} from "./src/html";

{
"name": "d3-request",
"version": "0.4.5",
"version": "0.4.6",
"description": "A convenient alternative to XMLHttpRequest.",

@@ -25,6 +25,6 @@ "keywords": [

"scripts": {
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"export var version = \\\"\" + require(\"./package.json\").version + \"\\\";\\n\");' > build/version.js && rollup -f umd -g d3-collection:d3_collection,d3-dispatch:d3_dispatch,d3-dsv:d3_dsv -n d3_request -o build/d3-request.js -- index.js && echo \"'use strict';\\n\\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;\" > build/d3-request.node.js && rollup -f cjs -g d3-collection:d3_collection,d3-dispatch:d3_dispatch,d3-dsv:d3_dsv -- index.js | tail -n+3 >> build/d3-request.node.js",
"test": "faucet `find test -name '*-test.js'` && eslint index.js src",
"prepublish": "npm run test && uglifyjs build/d3-request.js -c -m -o build/d3-request.min.js && rm -f build/d3-request.zip && zip -j build/d3-request.zip -- LICENSE README.md build/d3-request.js build/d3-request.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-request.js ../d3.github.com/d3-request.v0.4.js && cp build/d3-request.min.js ../d3.github.com/d3-request.v0.4.min.js && cd ../d3.github.com && git add d3-request.v0.4.js d3-request.v0.4.min.js && git commit -m \"d3-request ${VERSION}\" && git push"
"pretest": "rm -rf build && mkdir build && json2module package.json > build/package.js && bin/rollup-node && rollup -f umd -g d3-collection:d3_collection,d3-dispatch:d3_dispatch,d3-dsv:d3_dsv -n d3_request -o build/d3-request.js -- index.js",
"test": "tape 'test/**/*-test.js' && eslint index.js src",
"prepublish": "npm run test && uglifyjs build/d3-request.js -c -m -o build/d3-request.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-request.js ../d3.github.com/d3-request.v0.4.js && cp build/d3-request.min.js ../d3.github.com/d3-request.v0.4.min.js && cd ../d3.github.com && git add d3-request.v0.4.js d3-request.v0.4.min.js && git commit -m \"d3-request ${VERSION}\" && git push && cd - && zip -j build/d3-request.zip -- LICENSE README.md build/d3-request.js build/d3-request.min.js"
},

@@ -38,4 +38,4 @@ "dependencies": {

"devDependencies": {
"faucet": "0.0",
"rollup": "0.25",
"json2module": "0.0",
"rollup": "0.26",
"tape": "4",

@@ -42,0 +42,0 @@ "uglify-js": "2"

@@ -30,3 +30,3 @@ # d3-request

This module has built-in support for parsing [JSON](#json), [XML](#xml), [CSV](#csv) and [TSV](#tsv). You can parse additional formats by using [request](#request) or [text](#text) directly.
This module has built-in support for parsing [JSON](#json), [CSV](#csv) and [TSV](#tsv); in browsers, but not in Node, [HTML](#html) and [XML](#xml) are also supported. You can parse additional formats by using [request](#request) or [text](#text) directly.

@@ -208,2 +208,4 @@ ## Installing

HTML parsing requires a global document and relies on [DOM Ranges](https://dom.spec.whatwg.org/#ranges), which are [not supported by JSDOM](https://github.com/tmpvar/jsdom/issues/317) as of version 8.3; thus, this method is supported in browsers but not in Node.
<a name="json" href="#json">#</a> d3.<b>json</b>(<i>url</i>[, <i>callback</i>])

@@ -285,1 +287,3 @@

```
XML parsing relies on [*xhr*.responseXML](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML) which is not supported by [node-XMLHttpRequest](https://github.com/driverdan/node-XMLHttpRequest/issues/8) as of version 1.8; thus, this method is supported in browsers but not in Node.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc