asar-require-auto

1.2.4 • Public • Published

asar-require-auto (a Node Package)

This package will try to load asar file first.

It fix package asar-require cannot load asar package like...

require('asar-require');
 
// if you do this
const foo = require('./a_package.asar/index.js'); // will ok
 
// but this
const foo = require('./a_package.asar'); // will throw error

Install

npm install asar-require-auto

Usage

Just require it and use like normal require().

// require the package
const asarRequireAuto = require('asar-require-auto');
 
// If "./name_of_some_module.asar" exist, it will load it first!
// Other case it will load "./name_of_some_module" like normal.
const some_module = asarRequireAuto('name_of_some_module');

It will also read package.json file and load the script where in main field.

License

MIT License

Combinators

Readme

Keywords

Package Sidebar

Install

npm i asar-require-auto

Weekly Downloads

3

Version

1.2.4

License

MIT

Unpacked Size

4.2 kB

Total Files

10

Last publish

Collaborators

  • kiochan