npm install node-libcurl --save
var Curl = Curl;var curl = ;curl;curl;curl;curl;curl;
var Curl = Curl;var curl =close = curlclose;curl;curl;curl;curl;
For more examples check the examples folder.
Check the API Docs
The latest version of this package has prebuilt binaries (thanks to node-pre-gyp) available for the latest two (2) versions of Node.js on Active LTS (or Maintenance LTS, see https://github.com/nodejs/Release) and for the following platforms:
npm install node-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.
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
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, for the addon to use that libcurl version intead, you need to make sure that:
curl-configtool is in the PATH,
You need to have installed OS X >=10.8 and xcode >=4.5
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 and Visual Studio >=2013, you can get all that by running:
npm install --global --production windows-build-tools
Currently there is no support to use other libcurl version than the one provided by the curl-for-windows submodule.
From nw.js documentation:
Starting from 0.13.0, native modules built by node-gyp or npm in upstream can be supported.
In Linux and OSX you can just load the native module directly. In windows you’ll need to replace the file
%APPDATA%\npm\node_modules\node-gyp\src\win_delay_load_hook.cwith the one at https://github.com/nwjs/nw.js/blob/nw13/tools/win_delay_load_hook.c
Since we require
node-gyp as direct dependency, you probably will need to change that
file directly in the
node-gyp inside the
node_modules folder of your project.
Currently there are no prebuilt binaries for electron, to install node-libcurl, do the following:
npm install node-libcurl --runtime=electron --target=1.0.2 --disturl=https://atom.io/download/atom-shell --arch=x64 --save
--target says you want to build for the electron version 0.34.1.
--arch says the module should be built for 64bit.
You can put those args in a .npmrc file, like so:
runtime = electron target = 1.0.2 target_arch = x64 dist_url = https://atom.io/download/atom-shell
We are using
yarn on this project.
If on Windows, run:
$ node tools/update-deps.js
Install the node modules:
$ yarn install
$ yarn pregyp rebuild