Giter Club home page Giter Club logo

node-rasa's Introduction

rasa

npm npm license npm downloads build status

Dependency-less asar archive implementation

Install via npm

$ npm install --save rasa

Differences

Compared to electron/asar, rasa

  • Has no dependencies
  • Has no command line interface
  • Provides error handling for all methods

TODO

  • Packing of files
  • API compatibility with asar

Usage

var rasa = require( 'rasa' )

Listing an archive's contents

var files = rasa.listPackage( 'test/data/pack.asar' )
> [ 'archive.js', 'filesystem.js', 'rasa.js' ]

Opening an archive

var archive = new rasa.Archive()
archive.open( filename, ( error ) => {
  // Do things...
  console.log( 'files', rasa.Archive.listFiles( archive.root ) )
  // Close the handle to the archive
  archive.close()
})

Reading a file

archive.readFile( 'archive.js', function( error, buffer ) {
  // ...
})

Reading directories

var ls = archive.readdir( '/' )

Streaming a file from an archive

archive.createReadStream( 'archive.js' )
  .pipe( process.stdout )

node-rasa's People

Contributors

jhermsmeier avatar

Stargazers

 avatar

Watchers

 avatar  avatar

node-rasa's Issues

[bug] Content is read by -2 offset

There seems to be a bug when reading content using either readFile or createReadStream. The returned content always contain the 2 last characters from the previous file and is missing 2 characters from the end. If the requested file is the first one in the asar archive, the first 2 characters are unrecognized binary characters.

The .asar archive was created using the asar package and can be read just fine by other packages like express-serve-asar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.