@sasjs/utils 3.7.4 → 4.0.0
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/README.md +23 -0
- package/index.d.ts +0 -1
- package/index.js +6 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,29 @@
|
|
|
6
6
|
|
|
7
7
|
A library of utilities and types for SASjs written in TypeScript.
|
|
8
8
|
|
|
9
|
+
## Entry points
|
|
10
|
+
|
|
11
|
+
This is a Node library, and the barrel - `import { x } from '@sasjs/utils'` - is its Node
|
|
12
|
+
entry point. Importing from it pulls in the modules that only Node can run: `fs-extra` and
|
|
13
|
+
`@fast-csv/format` through `./file`, `prompts` through `./input`, `chalk` and `consola`
|
|
14
|
+
through `./logger` and `./formatter`.
|
|
15
|
+
|
|
16
|
+
Code that is bundled for a browser imports the subpath it needs instead:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
import { ServerType } from '@sasjs/utils/types'
|
|
20
|
+
import { prefixMessage } from '@sasjs/utils/error'
|
|
21
|
+
import { isSpecialMissing } from '@sasjs/utils/input/validators'
|
|
22
|
+
import { bytesToSize } from '@sasjs/utils/utils'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The hash and sync helpers - `getHash`, `compareHashes`, `extractHashArray`,
|
|
26
|
+
`generateCompileProgram`, `generateProgramToGetRemoteHash`, `generateProgramToSyncHashDiff`
|
|
27
|
+
and `findResourcesNotPresentLocally` - live in `@sasjs/utils/fs`. They hash files and
|
|
28
|
+
folders on disk, so they are Node-only, and the barrel does not re-export them: a browser
|
|
29
|
+
bundle that imports the barrel for anything else no longer reaches `crypto`, which used to
|
|
30
|
+
arrive with the whole AES/RSA/ECDSA polyfill suite behind it.
|
|
31
|
+
|
|
9
32
|
## Contributors ✨
|
|
10
33
|
|
|
11
34
|
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -20,5 +20,10 @@ __exportStar(require("./time"), exports);
|
|
|
20
20
|
__exportStar(require("./types"), exports);
|
|
21
21
|
__exportStar(require("./utils"), exports);
|
|
22
22
|
__exportStar(require("./compileTree"), exports);
|
|
23
|
-
|
|
23
|
+
// './fs' is deliberately absent: it is the only module here that imports
|
|
24
|
+
// `crypto`, and re-exporting it put that - plus browserify-sign, parse-asn1,
|
|
25
|
+
// asn1.js and vm-browserify, roughly 555 KB of AES/RSA/ECDSA polyfills and a
|
|
26
|
+
// vm shim's dynamic code execution - into every browser bundle that imported
|
|
27
|
+
// anything from this barrel. The helpers live at '@sasjs/utils/fs' instead.
|
|
28
|
+
// See sasjs/utils#275.
|
|
24
29
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsB;AACtB,yCAAsB;AACtB,8CAA2B;AAC3B,0CAAuB;AACvB,2CAAwB;AACxB,6CAA0B;AAC1B,yCAAsB;AACtB,0CAAuB;AACvB,0CAAuB;AACvB,gDAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsB;AACtB,yCAAsB;AACtB,8CAA2B;AAC3B,0CAAuB;AACvB,2CAAwB;AACxB,6CAA0B;AAC1B,yCAAsB;AACtB,0CAAuB;AACvB,0CAAuB;AACvB,gDAA6B;AAC7B,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,uBAAuB"}
|
package/package.json
CHANGED