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.
Files changed (2) hide show
  1. package/dist/index.cjs +5 -13
  2. 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
- var _default = exports.default = cannibalizr;
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 = _nodeFs.default.readFileSync(input.file, {
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
- _nodeFs.default.writeFileSync(options.output.file, JSON.stringify(output));
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.6",
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 (@localnerve)",
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": "^7.28.6",
46
- "@babel/core": "^7.29.0",
47
- "@babel/preset-env": "^7.29.5",
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.3.0",
50
- "globals": "^17.6.0"
49
+ "eslint": "^10.6.0",
50
+ "globals": "^17.7.0"
51
51
  },
52
- "pre-commit": [
53
- "lint",
54
- "test"
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
  }