file-get-contents.js:Node.js版本的file_get_contents PHP函数

时间:2021-05-10 00:37:40
【文件属性】:
文件名称:file-get-contents.js:Node.js版本的file_get_contents PHP函数
文件大小:4KB
文件格式:ZIP
更新时间:2021-05-10 00:37:40
JavaScript fileGetContents.js Node.js版本的 PHP函数 客观的 轻松处理对URL或将文件系统包装成Promise的请求 例子 const fileGetContents = require ( 'file-get-contents' ) ; // A File request try { let data = await fileGetContents ( '/tmp/foo/bar' ) ; console . log ( data ) ; } catch ( err ) { console . log ( 'Unable to load data from /tmp/foo/bar' ) ; } // Or a HTTP(S) request fileGetContents ( 'https://pokeapi.co/api/v2/pokemon/1/' ) .
【文件预览】:
file-get-contents.js-master
----index.js(4KB)
----package.json(495B)
----LICENSE(1KB)
----example.js(882B)
----README.md(741B)

网友评论