cannibalizr 5.0.6 → 5.0.7
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.
- package/dist/index.cjs +5 -13
- package/package.json +16 -10
package/dist/index.cjs
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.cannibalizr = cannibalizr;
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _nodeFs = _interopRequireDefault(require("node:fs"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
1
|
/***
|
|
11
2
|
* Copyright (c) 2016 - 2025 Alex Grant (@localnerve), LocalNerve LLC
|
|
12
3
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file
|
|
13
4
|
* for terms.
|
|
14
5
|
*/
|
|
15
|
-
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
export default cannibalizr;
|
|
16
8
|
/**
|
|
17
9
|
* Pull strings from multiple input files, write to structured json.
|
|
18
10
|
*
|
|
@@ -47,7 +39,7 @@ var _default = exports.default = cannibalizr;
|
|
|
47
39
|
* @param {Function} [options.logger] - A logger to use.
|
|
48
40
|
* @returns {Undefined} Nothing.
|
|
49
41
|
*/
|
|
50
|
-
function cannibalizr(options) {
|
|
42
|
+
export function cannibalizr(options) {
|
|
51
43
|
const output = {};
|
|
52
44
|
|
|
53
45
|
// used to trim "|' from the beginning and end of a captured result.
|
|
@@ -82,7 +74,7 @@ function cannibalizr(options) {
|
|
|
82
74
|
};
|
|
83
75
|
Object.keys(options.input).forEach(item => {
|
|
84
76
|
options.input[item].forEach(input => {
|
|
85
|
-
const contents =
|
|
77
|
+
const contents = fs.readFileSync(input.file, {
|
|
86
78
|
encoding: 'utf8'
|
|
87
79
|
});
|
|
88
80
|
input.captures.forEach(capSpec => {
|
|
@@ -102,5 +94,5 @@ function cannibalizr(options) {
|
|
|
102
94
|
});
|
|
103
95
|
report(output[item], item);
|
|
104
96
|
});
|
|
105
|
-
|
|
97
|
+
fs.writeFileSync(options.output.file, JSON.stringify(output));
|
|
106
98
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cannibalizr",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.7",
|
|
4
4
|
"description": "Turns an old pile of rusty files into a new json data source",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"files": [
|
|
33
33
|
"dist/"
|
|
34
34
|
],
|
|
35
|
-
"author": "Alex Grant
|
|
35
|
+
"author": "Alex Grant <alex@localnerve> (https://www.localnerve.com)",
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"bugs": {
|
|
38
38
|
"url": "https://github.com/localnerve/cannibalizr/issues"
|
|
@@ -42,15 +42,21 @@
|
|
|
42
42
|
"node": ">=20"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@babel/cli": "^
|
|
46
|
-
"@babel/core": "^
|
|
47
|
-
"@babel/preset-env": "^
|
|
45
|
+
"@babel/cli": "^8.0.1",
|
|
46
|
+
"@babel/core": "^8.0.1",
|
|
47
|
+
"@babel/preset-env": "^8.0.2",
|
|
48
48
|
"@eslint/js": "^10.0.1",
|
|
49
|
-
"eslint": "^10.
|
|
50
|
-
"globals": "^17.
|
|
49
|
+
"eslint": "^10.6.0",
|
|
50
|
+
"globals": "^17.7.0"
|
|
51
51
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
"funding": [
|
|
53
|
+
{
|
|
54
|
+
"type": "github",
|
|
55
|
+
"url": "https://github.com/sponsors/localnerve"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "paypal",
|
|
59
|
+
"url": "https://www.paypal.com/ncp/payment/DHCB5GUYMGX5U"
|
|
60
|
+
}
|
|
55
61
|
]
|
|
56
62
|
}
|