strict-mode:在您的包裹中启用严格模式

时间:2021-05-28 01:04:15
【文件属性】:
文件名称:strict-mode:在您的包裹中启用严格模式
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-28 01:04:15
JavaScript 严格模式 在您的包裹中启用严格模式 安装 用做 npm install strict-mode --save-dev NOTA BENE你可能要安装严格的模式作为发展的依赖,见。 用法 请注意,该软件包旨在用于服务器端。 如果与使用,则为 。 假设package.json中的main属性是index.js 。 如果您希望软件包中的所有模块都启用严格模式,只需用这种方式包装index.js require ( 'strict-mode' ) ( function ( ) { // your index.js content // every *require* call inside this function will have strict mode enabled } ) 动机 是一种最佳实践,但要添加"use strict"; 在您程序包中每个.js文件的顶部 需要很大的努力
【文件预览】:
strict-mode-master
----browser.js(88B)
----Development.md(144B)
----.npmignore(20B)
----LICENSE(1KB)
----test()
--------strict-mode.test.js(684B)
--------nested()
--------noStrictCode1.js(576B)
--------noStrictCode2.js(505B)
----README.md(4KB)
----strict-mode.js(1KB)
----.gitignore(42B)
----package-lock.json(74B)
----package.json(699B)

网友评论