Skip to content

Create a browser-like environment within a NodeJS context

Notifications You must be signed in to change notification settings

seebigs/node-as-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-as-browser

Create a browser-like environment within a Node.js context

Install

$ npm install node-as-browser

Use

var nodeAsBrowser = require('node-as-browser');

nodeAsBrowser.init(global);

console.log(navigator.userAgent);

Scope

var nodeAsBrowser = require('node-as-browser');

var fakeWindow = {};
nodeAsBrowser.init(fakeWindow);

console.log(fakeWindow.navigator.userAgent);

About

Create a browser-like environment within a NodeJS context

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published