New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

requireasync

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

requireasync

async require for the browser, also works in node

latest
Source
npmnpm
Version
0.0.19
Version published
Maintainers
1
Created
Source

requireasync

usage

if(!window)var window=eval(require('requireasync').install);else var node=false,browser=true;

    REQUIRE(
        ["fs", "path.resolve"],
    function (err, fs, resolve) {

		    fs.readFile(resolve(".","readme,md"),function(err,data){
			
			    console.log(err,data);
			
		    })
	    }
    )

Shorthand: $R$ can be substituted for REQUIRE

Try this for an instant load and run one liner:

console.log($R$({path:"resolve"})(".","myfile.js"));

See the html folder for a working demo.

change to that folder and type

$ npm install .
$ node demo.js

To load the demo server, and it will give you a local browser url along the lines of

visit http://localhost:8080/index.html to demo the browser files

FAQs

Package last updated on 05 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts