package
Test whether you're a component in browser or a package in npm
npm install is-browserGitHub-flavored package documentation.
Across all versions, last 30 days.
3,848,795 in 30 days
Runtime metadata.
Estimated unpacked size across 1 packages.
1.9 kB
Includes dependencies.
Test whether you're running on the server or in the browser (using browserify)
$ npm install is-browserThis simply exports true or false:
if (require('is-browser')) {
console.log('The module was installed using component');
} else {
console.log('The module was installed using npm');
}MIT