npm.io
1.0.1 • Published 11 years ago

promise_require

Licence
ISC
Version
1.0.1
Deps
0
Vulns
0
Weekly
0

###a promise-style of commonjs'require, such as:

    require('./foo').then(function(exports) {
        console.log(exports); //your commonjs module.exports
    });

###for example:

    
    <script src="index.js"></script>

    <script>
        //make sure you are not in file path in order to prevent CORS
        require('test').then(function(exports) {
        console.log(exports.name); //'zank'
    });
    </script>

Keywords