Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created January 5, 2016 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podhmo/c17f6e7b720019787729 to your computer and use it in GitHub Desktop.
Save podhmo/c17f6e7b720019787729 to your computer and use it in GitHub Desktop.
'use strict';
var benv = require('benv');
function setup(cb){
benv.setup(function(){
global.Node = window.Node;
benv.expose({
angular: benv.require('./node_modules/angular/angular.js', 'angular')
});
cb();
});
}
setup(function(){
console.log('window is', typeof window);
console.log('document is', typeof document);
console.log('angular is', typeof angular);
console.log('window.angular === angular', window.angular === angular);
});
{
"name": "api-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"angular": "^1.4.8"
},
"devDependencies": {
"benv": "^3.0.0"
}
}
@podhmo
Copy link
Author

podhmo commented Jan 5, 2016

$ node loadSample.js
window is object
document is object
angular is object
window.angular === angular true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment