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

A convenient alternative to XMLHttpRequest.

  • 0.4.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
135K
decreased by-26.53%
Maintainers
1
Weekly downloads
 
Created

What is d3-request?

The d3-request npm package is a part of the D3.js library and is used for making HTTP requests. It provides a simple API for fetching data from a server, which is particularly useful for loading data in various formats such as JSON, CSV, and XML for data visualization purposes.

What are d3-request's main functionalities?

Fetching JSON Data

This feature allows you to fetch JSON data from a specified URL. The callback function handles the response, where you can process the data or handle errors.

const d3 = require('d3-request');
d3.json('https://api.example.com/data', function(error, data) {
  if (error) throw error;
  console.log(data);
});

Fetching CSV Data

This feature allows you to fetch CSV data from a specified URL. The callback function processes the CSV data into an array of objects.

const d3 = require('d3-request');
d3.csv('https://api.example.com/data.csv', function(error, data) {
  if (error) throw error;
  console.log(data);
});

Fetching XML Data

This feature allows you to fetch XML data from a specified URL. The callback function processes the XML data, which can then be manipulated as needed.

const d3 = require('d3-request');
d3.xml('https://api.example.com/data.xml', function(error, data) {
  if (error) throw error;
  console.log(data);
});

Fetching Text Data

This feature allows you to fetch plain text data from a specified URL. The callback function handles the text response.

const d3 = require('d3-request');
d3.text('https://api.example.com/data.txt', function(error, data) {
  if (error) throw error;
  console.log(data);
});

Other packages similar to d3-request

Keywords

FAQs

Package last updated on 20 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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