lepton_wrapper

1.0.1 • Public • Published

Node-Lepton

A NodeJS wrapper library for Dropbox Lepton compression tool.

Quick start

This guide assumes you have node/npm already installed.

First, run npm install lepton_wrapper for your app. Then, import it in your app:

var lepton = require('lepton_wrapper');

// ...

After this you can run the below command to compress or decompress. You must provide a valid path for both of the files.

These functions takes a callback that returns an error object and the output in form of a binary file blob.

For Compression:

let sourceFileName = "IMG_20220101_004700.jpg";
let compressedFileName = "IMG_20220101_004700.lep";

lepton.execute(sourceFileName,  compressedFileName,
{
  unjailed: true,
},
function(err, data){
  if(err) throw err;
  
  console.log(`Successfully compressed ${sourceFileName}`);
});

For Decompression:

let sourceFileName = "IMG_20220101_004700.lep";
let decompressedFileName = "IMG_20220101_004700.jpg";

lepton.execute(sourceFileName,  decompressedFileName,
{
  unjailed: true,
},
function(err, data){
  if(err) throw err;
  
  console.log(`Successfully decompressed ${sourceFileName}`);
});

Options

unjailed

type: Boolean

Package Sidebar

Install

npm i lepton_wrapper

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

2.74 kB

Total Files

3

Last publish

Collaborators

  • balakumar_s