Installations
npm install fs-read-data
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=6.0.0
Node Version
8.8.1
NPM Version
6.1.0
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (51.06%)
TypeScript (48.94%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
tufan-io
Download Statistics
Total Downloads
5,102
Last Day
1
Last Week
17
Last Month
45
Last Year
268
GitHub Statistics
4 Stars
15 Commits
1 Forks
2 Watching
10 Branches
1 Contributors
Bundle Size
310.82 kB
Minified
81.00 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.4
Package Id
fs-read-data@1.0.4
Unpacked Size
25.29 kB
Size
9.32 kB
File Count
9
NPM Version
6.1.0
Node Version
8.8.1
Total Downloads
Cumulative downloads
Total Downloads
5,102
Last day
-50%
1
Compared to previous day
Last week
21.4%
17
Compared to previous week
Last month
246.2%
45
Compared to previous month
Last year
7.2%
268
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
fs-read-data
fs-read-data
is a simple mechanism to read files in this one of multiple formats {json, js, yaml, ini, toml}.
Provides a CLI and API interface to underlying capability, making conversion of data-formats a breeze, especially when coupled with fs-write-data
Why?
It's common to have data files in one of multiple well-known formats (json, yaml, ini, toml). Sometimes these are config files, sometimes they are just declartive definitions.
This is a tool to help work with such files without getting in your way.
Great for checking validity of hand-crafted data files.
Compared to a single spurious babel module installation, the additional weight of multiple file parsers was considered acceptable collateral-weight.
Installation
1npm install fs-read-data
1yarn install fs-read-data
Usage
CLI
1 2 Usage: read-data [fname] 3 4 reads [fname] in {json, yaml, ini, toml}, prints resulting json to stdout. 5 6 7 Options: 8 9 -V, --version output the version number 10 -h, --help output usage information
API
Exposes a single function via the API
1/** 2 * Reads filename in one of the supported formats 3 * and returns a promise that resolves to a JavaScript object. 4 * 5 * @async 6 * @param fname file to read 7 */ 8async readFile(fname);
1 2const read = require('fs-read-data'); 3 4// one of these 5const data = read(`/path/to/file/data`); // auto-detects available extension. Error if multiple found 6const data = read(`/path/to/file/data.json`); 7const data = read(`/path/to/file/data.yaml`); 8const data = read(`/path/to/file/data.yml`); 9const data = read(`/path/to/file/data.js`); // must return a single object 10const data = read(`/path/to/file/data.ini`); 11const data = read(`/path/to/file/data.toml`);
Development Tooling
Related
Dependencies
This is an aggregation module, much like fs-extra. It's built upon the shoulders of libraries that provide it's core functionality.
Support cast: awaiting commander
License
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Support
Bugs, PRs, comments, suggestions welcomed!
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 6 are checked with a SAST tool
Reason
39 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-px4h-xg32-q955
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to fs-read-data
write-json
Write a JSON file to disk, also creates intermediate directories in the destination path if they don't already exist.
@cronvel/get-pixels
Pruned version of the 'get-pixels' package by Mikola Lysenko (only node.js and local fs files)
data-forge-fs
This library contains the file system extensions to Data-Forge that allow it to directly read and write CSV and JSON files in Node.js.
data-fs
create read update an delete binary record (database like file system)