A NodeJS wrapper library for Dropbox JPEG Lepton compression tool.
This guide assumes you have Dropbox Lepton and node/npm already installed.
First, run npm install node-lepton --save
for your app. Then, in an Express app:
var lepton = require('node-lepton');
// ...
After this you can run one of two commands, compress or decompress. You must provide a valid path for either of these functions to work.
These functions takes a callback that returns an error object and the output in form of a binary file blob.
lepton.compress('../../aoeu.jpeg',
{
unjailed: true,
},
function(err, data){
if(err) throw err;
console.log('Successfully compressed aoeu.jpeg');
});
lepton.decompress('../../aoeu.lep',
{
unjailed: true,
},
function(err, data){
if(err) throw err;
console.log('Successfully decompressed aoeu.lep');
});
type: Boolean
type: Boolean
type: Integer
type: Boolean
type: Boolean
type: Boolean
type: Boolean
type: Integer (in ms)
type: Boolean or Integer (port)
type: Boolean or Integer
type: Boolean or Integer