文件名称:detect-node:检测Node.JS
文件大小:2KB
文件格式:ZIP
更新时间:2024-05-25 01:00:52
JavaScript
安装 npm install --save detect-node 用法: var isNode = require ( 'detect-node' ) ; if ( isNode ) { console . log ( "Running under Node.JS" ) ; } else { alert ( "Hello from browser (or whatever not-a-node env)" ) ; } 该检查按以下方式执行: module . exports = false ; // Only Node.JS has a process variable that is of [[Class]] process try { module . exports = Object . prototype . toString . call ( global .
【文件预览】:
detect-node-master
----browser.js(25B)
----Readme.md(691B)
----LICENSE(1KB)
----index.js(186B)
----package.json(579B)