exists-file:检查文件是否存在。 一个不存在的fs.exists实现

时间:2021-05-12 17:06:21
【文件属性】:
文件名称:exists-file:检查文件是否存在。 一个不存在的fs.exists实现
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-12 17:06:21
JavaScript 存在文件 检查文件是否存在。 一个不存在的fs.exists实现。 由于和都不赞成这种使用实施和为得到相同的结果。 还请始终牢记: 在调用fs.open()之前,不应使用fs.exists()检查文件是否存在。 这样做会引入竞争条件,因为其他进程可能会在两次调用之间更改文件的状态。 而是,用户代码应直接调用fs.open()并处理文件不存在时引发的错误。 安装 npm install exists-file --save 用法 var existsFile = require ( 'exists-file' ) // async with a callback existsFile ( './README.md' , console . log ) // => null, true // async with a promise existsFile ( './README.md'
【文件预览】:
exists-file-master
----.travis.yml(83B)
----index.js(524B)
----package.json(1KB)
----.github()
--------dependabot.yml(257B)
----test()
--------index.js(2KB)
--------mocha.opts(68B)
----example.js(296B)
----.npmignore(120B)
----.bumpedrc(681B)
----LICENSE.md(1KB)
----.gitignore(416B)
----CHANGELOG.md(3KB)
----.npmrc(17B)
----README.md(2KB)
----.editorconfig(364B)
----.gitattributes(12B)

网友评论