Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 1, 2024 via pnpm

needle 3.3.1

The leanest and most handsome HTTP client in the Nodelands.
Package summary
Share
0
issues
2
licenses
3
MIT
1
ISC
Package created
11 Dec 2011
Version published
12 Dec 2023
Maintainers
1
Total deps
4
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
iconv-lite@0.6.3
needle@3.3.1
safer-buffer@2.1.2

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
sax@1.3.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of needle 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
iconv-lite0.6.3186.2 kBMIT
prod
sax1.3.014.99 kBISC
prod

Visualizations

Frequently Asked Questions

What does needle do?

Needle is a streamlined and efficient HTTP client for Node.js. This popular npm package is celebrated for its simplicity and lean structure, making it an ideal utility for rapid HTTP requests in Node.js. The package supports HTTP and HTTPS requests, various forms of authentication, multipart form-data, and automatic XML & JSON parsing among other advanced features. Its unique selling feature is its effectiveness in managing both simple and complex HTTP requests, including interaction with APIs and streaming of data.

How do you use needle?

To utilize Needle in a Node.js environment, users need to install the package and then include it within the code. The package can be installed via npm using the following command:

$ npm install needle

After successfully installing the package, it can be implemented in your application in the following ways:

For a basic GET request:

var needle = require('needle');

needle.get('http://www.google.com', function(error, response) {
  if (!error && response.statusCode == 200)
    console.log(response.body);
});

For a POST request with callbacks:

var data = {
  file: '/home/johnlennon/walrus.png',
  content_type: 'image/png'
};

needle.post('https://my.server.com/foo', data, { multipart: true })
  .on('readable', function() { /* eat your chunks */ })
  .on('done', function(err) {
    console.log('Ready-o!');
  });

And for a PUT request with promises:

needle('put', 'https://hacking.the.gibson/login', { password: 'god' }, { json: true })
  .then(function(response) {
    return doSomethingWith(response);
  })
  .catch(function(err) {
    console.log('Call the locksmith!');
  });

Where are the needle docs?

The comprehensive documentation for Needle is hosted on the github repository. The documentation provides detailed information about the package, its usage, examples, and options for various types of HTTP requests. It also includes information about handling responses, setting default options, testing, and the various event emissions that Needle supports.