【文件属性】:
文件名称:plain-text-data-to-json:将简单的纯文本数据库转换为JSON
文件大小:8KB
文件格式:ZIP
更新时间:2021-02-12 11:13:55
json data text plain txt
纯文本数据到json
将“数据库” /基本(单词,短语)列表从纯文本转换为JSON。
安装
:
npm install plain-text-data-to-json
利用
var fs = require ( 'fs' )
var toJSON = require ( 'plain-text-data-to-json' )
var doc = fs . readFileSync ( 'input.txt' , 'utf8' )
var data = toJSON ( doc )
fs . writeFileSync ( 'output.json' , JSON . stringify ( data , null , 2 ) + '\n' )
API
toJSON(value[, options])
将给定的值(字符串)转换为JSON。 不喜欢默认的注释和属性-值对定界符? 指定您
【文件预览】:
plain-text-data-to-json-main
----.github()
--------workflows()
----.prettierignore(80B)
----funding.yml(15B)
----test.js(6KB)
----license(1KB)
----.npmrc(19B)
----.editorconfig(147B)
----.gitignore(121B)
----index.js(3KB)
----readme.md(4KB)
----package.json(2KB)