npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodejs-libcurl

v0.9.2

Published

[![Join the chat at https://gitter.im/JCMais/node-libcurl](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/JCMais/node-libcurl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Downloads

1

Readme

node-libcurl

Join the chat at https://gitter.im/JCMais/node-libcurl

NPM version node io.js license

Travis CI Status AppVeyor CI Status Code Quality Dependencies

Libcurl bindings for Node.js. Based on the work from jiangmiao/node-curl.

Quick Start

Install

npm install node-libcurl --save

Simple Request

var Curl = require( 'node-libcurl' ).Curl;

var curl = new Curl();

curl.setOpt( 'URL', 'www.google.com' );
curl.setOpt( 'FOLLOWLOCATION', true );

curl.on( 'end', function( statusCode, body, headers ) {

    console.info( statusCode );
    console.info( '---' );
    console.info( body.length );
    console.info( '---' );
    console.info( this.getInfo( 'TOTAL_TIME' ) );

    this.close();
});

curl.on( 'error', curl.close.bind( curl ) );
curl.perform();

MultiPart Upload / HttpPost libcurl Option

var Curl = require( 'node-libcurl' ).Curl;

var curl = new Curl(),
    close = curl.close.bind( curl );

curl.setOpt( curl.option.URL, '127.0.0.1/upload.php' );
curl.setOpt( curl.option.HTTPPOST, [
    { name: 'input-name', file: '/file/path', type: 'text/html' },
    { name: 'input-name2', contents: 'field-contents' }
]);

curl.on( 'end', close );
curl.on( 'error', close );

For more examples check the examples folder.

API

Check the API Docs

Detailed Installation

This package has prebuilt binaries (thanks to node-pre-gyp) available for the following platforms:

  • Linux 64 bits
  • Mac OS X 64 bits
  • Windows 32 and 64 bits

Just running npm install nodejs-libcurl should install a prebuilt binary and no compilation will be needed.

If there is no prebuilt binary available that matches your system, or if the installation fails, then you will need an environment capable of compilling nodejs addons, which means python 2.7 installed and an updated C++ compiler able to compile C++11.

If you don't want to use a prebuilt binary you can pass --build-from-source to the arguments list.

Linux

The only compiler supported on linux is gcc >=4.8, also you need to have the libcurl development files available, if you are running debian for example, you must install the libcurl4-openssl-dev package.

If you don't want to use the libcurl version shipped with your system, since it's probably very old (debian 7 uses libcurl 7.26 which is more than 3 years old, and had more than 1000 bugfixes already), you can install libcurl from source, the addon will pick the libcurl info using the curl-config tool, that way you only need to make sure that the libcurl you installed is in the path and in higher priority than the system one.

OS X

You need to have installed OS X >=10.8 and xcode >=4.5

If you want to install using a different version of libcurl, the same instructions for linux applies.

Windows

If installing using a prebuilt binary you only need to have the visual c++ 2013 runtime library. If building from source, you need to have Python 2.7, Visual Studio >=2013 and git

Currently there is no support to use other libcurl version than the one provided by the curl-for-windows submodule.

nw.js (aka node-webkit)

Currently there are no prebuilt binaries for node-webkit, to install node-libcurl, do the following:

  1. Install nw-gyp
npm install nw-gyp -g
  1. Install node-libcurl
npm install node-libcurl --runtime=node-webkit --target=0.12.3 --arch=x64 --msvs_version=2013 --build-from-source --save

--target says you want to build for the node-webkit version 0.12.3.

--arch says the module should be built for 64bit.

electron (aka atom-shell)

Currently there are no prebuilt binaries for electron, to install node-libcurl, do the following:

npm install node-libcurl --runtime=electron --target=0.34.1 --arch=x64 --build-from-source --save

--target says you want to build for the electron version 0.34.1.

--arch says the module should be built for 64bit.