read-data-file 2.0.2 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ // -*- coding: utf-8, tab-width: 2 -*-
3
+
4
+ import 'p-fatal';
5
+ import 'usnam-pmb';
6
+
7
+ import pEachSeries from 'p-each-series';
8
+
9
+ import readDataFile from '../rdf.mjs';
10
+
11
+ pEachSeries(process.argv.slice(2), async function repack(arg) {
12
+ const data = await readDataFile(arg);
13
+ console.log(JSON.stringify(data, null, 2));
14
+ });
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  { "name": "read-data-file",
2
- "version": "2.0.2",
2
+ "version": "2.0.5",
3
3
  "description": "Read data/config files in various formats (parsers list is configurable).",
4
4
  "keywords": [
5
5
  "read data file",
@@ -19,33 +19,41 @@
19
19
 
20
20
  "private": false, "license": "ISC",
21
21
  "main": "rdf.js",
22
-
23
- "scripts": {
24
- "test": "nodemjs test/all.mjs"
22
+ "bin": {
23
+ "datafile2json": "bin/df2json.mjs"
25
24
  },
26
25
 
26
+ "scripts": { "test": "elp && nodemjs test/all.mjs" },
27
+ "directories": { "test": "test" },
28
+ "eslintConfig": { "extends": "nodejs-pmb" },
29
+
27
30
  "dependencies": {
28
- "ceson": "^0.1.3",
29
- "esmod-pmb": "^0.1.11",
31
+ "ceson": "^0.1.5",
32
+ "esmod-pmb": "^0.1.13",
30
33
  "getown": "^1.0.0",
31
- "if-fun": "^1.0.0",
32
- "ini": "^1.3.5",
33
- "is-string": "^1.0.4",
34
- "js-yaml": "^3.12.1",
34
+ "if-fun": "^1.0.1",
35
+ "ini": "^2.0.0",
36
+ "is-string": "^1.0.7",
35
37
  "json-parse-pmb": "^1.0.0",
36
- "json5": "^2.1.3",
38
+ "json5": "^2.2.0",
37
39
  "map-assoc-core": "^0.1.3",
38
- "merge-options": "^1.0.1",
40
+ "merge-options": "^3.0.4",
39
41
  "nofs": "^0.12.2",
42
+ "p-each-series": "^2.2.0",
43
+ "p-fatal": "^0.1.3",
44
+ "safeload-yaml-pmb": "^4.210519.0",
40
45
  "strip-bom": "^4.0.0",
41
- "toml": "^3.0.0"
46
+ "toml": "^3.0.0",
47
+ "usnam-pmb": "^0.2.5"
42
48
  },
43
49
  "devDependencies": {
44
50
  "absdir": "^1.0.6",
45
51
  "equal-pmb": "^0.1.24",
46
- "nodemjs": "^0.1.8",
47
- "p-fatal": "^0.1.3",
48
- "usnam-pmb": "^0.2.4"
52
+ "eslint-config-nodejs-pmb": "^0.3.5",
53
+ "eslint-plugin-json-light-pmb": "^1.0.7",
54
+ "eslint-plugin-n": "^15.2.4",
55
+ "eslint-pretty-pmb": "^1.0.5",
56
+ "nodemjs": "^0.1.11"
49
57
  },
50
58
 
51
59
 
package/rdf.js CHANGED
@@ -1 +1,2 @@
1
- require('esmod-pmb')(module);
1
+ 'use strict';
2
+ require('esmod-pmb')(module);
package/rdf.mjs CHANGED
@@ -10,12 +10,12 @@ import mergeOpts from 'merge-options';
10
10
  import promisedFs from 'nofs';
11
11
  import stripBom from 'strip-bom';
12
12
 
13
- import cesonParser from 'ceson/parse';
13
+ import cesonParser from 'ceson/parse.js';
14
14
  import iniLib from 'ini';
15
15
  import json5Lib from 'json5';
16
16
  import jsonParser from 'json-parse-pmb';
17
17
  import tomlLib from 'toml';
18
- import yamlLib from 'js-yaml';
18
+ import yamlSafeLoad from 'safeload-yaml-pmb';
19
19
 
20
20
 
21
21
  function makeReaderFunc() {
@@ -43,7 +43,7 @@ const defaultImpl = {
43
43
  json: jsonParser,
44
44
  json5(data) { return json5Lib.parse(data); },
45
45
  toml(data) { return tomlLib.parse(data); },
46
- yaml(data) { return yamlLib.safeLoad(data); },
46
+ yaml(data) { return yamlSafeLoad(data); },
47
47
  yml: 'yaml',
48
48
  },
49
49
 
package/test/all.mjs CHANGED
@@ -3,4 +3,4 @@
3
3
  import 'usnam-pmb';
4
4
  import 'p-fatal';
5
5
 
6
- import './usage';
6
+ import './usage.mjs';
package/test/usage.mjs CHANGED
@@ -5,7 +5,7 @@ import equal from 'equal-pmb';
5
5
  import absdir from 'absdir';
6
6
 
7
7
  // ¦mjsUsageDemo¦+
8
- import readDataFile from '..';
8
+ import readDataFile from '../rdf.mjs';
9
9
  import nativeCats from './cats.json';
10
10
  // ¦mjsUsageDemo¦- importPkgName
11
11