@terzogenito/json-utils 1.0.6 → 1.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/index.js +5 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const https = require('https');
|
|
3
3
|
|
|
4
|
+
function getString(filePath) {
|
|
5
|
+
return fs.readFileSync(filePath, 'utf-8');
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
function getFile(filePath, callback) {
|
|
5
9
|
fs.readFile(filePath, 'utf8', (err, data) => {
|
|
6
10
|
if (err) {
|
|
@@ -107,6 +111,7 @@ function beautifyJSON(jsonString, indent) {
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
module.exports = {
|
|
114
|
+
getString,
|
|
110
115
|
getFile,
|
|
111
116
|
getData,
|
|
112
117
|
getURL,
|