Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Wizcorp/curlyfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Curlyfile

Direct file download in Node.js, using libcurl.

The goal of this module is to avoid sending data in JavaScript-land; while piping works perfectly fine, it also increases CPU usage for no good reason when all we want is to download a file to disk.

So this module simply pipes libcurl to a file, all in C/C++.

Requirements

Currently tested on Windows 10 and macOS.

  • CMake 3.5+

Installation

npm install --save Curlyfile

Usage

const Curlyfile = require('curlyfile').Curlyfile
const curly = new Curlyfile()
curly.download('http://some.file.com/hello', '/tmp/test-curly', function (error) {
  console.log('Done!', error ? error : null)
})

Development

git clone ...
cd curlyfile
git submodule update --init
# Or any cmake.js command - npm run -- cmake -h for more details
npm run cmake build

Todo

  • Proper tests
  • Cancel API
  • Progress API (# of bytes downloaded so far)
  • Prebuild for Node.js and Electron

About

Direct download in Node.js, using libcurl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published