git ssb

0+

cel-desktop / ssb-pkg



Tree: ca90b5ca0579ebdcc0635288bce4978e3fb200f5

Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-79-npm / node-libcurl / node-libcurl.js

490 bytesRaw
1'use strict';
2
3// apt-get install libcurl4-openssl-dev
4
5// IF YOU USE 32-BIT NODEJS:
6// patch /usr/include/curl/curlbuild.h
7// #define CURL_SIZEOF_LONG 4
8// #define CURL_SIZEOF_CURL_OFF_T 4
9
10var Curl = require('node-libcurl').Curl;
11var curl = new Curl();
12curl.setOpt('URL', 'www.yandex.ru');
13curl.setOpt('FOLLOWLOCATION', true);
14curl.on('end', function (status) {
15 if (status === 200) {
16 console.log('ok');
17 }
18 this.close(); // eslint-disable-line no-invalid-this
19});
20curl.perform();
21

Built with git-ssb-web