angular-slickgrid 4.2.1 → 4.2.2
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/LICENSE +20 -20
- package/app/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +2 -2
- package/app/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -2
- package/docs/assets/lib/multiple-select/README.md +17 -17
- package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +14 -14
- package/esm2020/app/modules/angular-slickgrid/constants.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/extensions/index.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +2 -4
- package/esm2020/app/modules/angular-slickgrid/global-grid-options.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/index.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/gridOption.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/index.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +7 -10
- package/esm2020/app/modules/angular-slickgrid/services/angularUtil.service.mjs +4 -4
- package/esm2020/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +4 -4
- package/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +4 -4
- package/esm2020/app/modules/angular-slickgrid/services/index.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/services/translater.service.mjs +4 -4
- package/esm2020/app/modules/angular-slickgrid/services/utilities.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/slickgrid-config.mjs +1 -1
- package/esm2020/public_api.mjs +1 -1
- package/fesm2015/angular-slickgrid.mjs +32 -37
- package/fesm2015/angular-slickgrid.mjs.map +1 -1
- package/fesm2020/angular-slickgrid.mjs +32 -37
- package/fesm2020/angular-slickgrid.mjs.map +1 -1
- package/i18n/en.json +89 -89
- package/i18n/fr.json +90 -90
- package/{angular-slickgrid.d.ts → index.d.ts} +0 -0
- package/package.json +11 -11
- package/test/cypress/node_modules/@cypress/request/README.md +1038 -0
- package/test/cypress/node_modules/@cypress/xvfb/README.md +48 -0
- package/test/cypress/node_modules/@cypress/xvfb/node_modules/debug/README.md +437 -0
- package/test/cypress/node_modules/@types/node/README.md +16 -0
- package/test/cypress/node_modules/@types/sinonjs__fake-timers/README.md +16 -0
- package/test/cypress/node_modules/@types/sizzle/README.md +16 -0
- package/test/cypress/node_modules/@types/yauzl/README.md +16 -0
- package/test/cypress/node_modules/@types/yauzl/node_modules/@types/node/README.md +16 -0
- package/test/cypress/node_modules/aggregate-error/README.md +61 -0
- package/test/cypress/node_modules/ansi-colors/README.md +315 -0
- package/test/cypress/node_modules/ansi-escapes/README.md +245 -0
- package/test/cypress/node_modules/ansi-regex/README.md +78 -0
- package/test/cypress/node_modules/ansi-styles/README.md +152 -0
- package/test/cypress/node_modules/arch/README.md +71 -0
- package/test/cypress/node_modules/asn1/README.md +50 -0
- package/test/cypress/node_modules/assert-plus/README.md +162 -0
- package/test/cypress/node_modules/astral-regex/README.md +46 -0
- package/test/cypress/node_modules/async/README.md +60 -0
- package/test/cypress/node_modules/asynckit/README.md +233 -0
- package/test/cypress/node_modules/at-least-node/README.md +25 -0
- package/test/cypress/node_modules/aws-sign2/README.md +4 -0
- package/test/cypress/node_modules/aws4/README.md +183 -0
- package/test/cypress/node_modules/balanced-match/README.md +91 -0
- package/test/cypress/node_modules/base64-js/README.md +34 -0
- package/test/cypress/node_modules/bcrypt-pbkdf/README.md +45 -0
- package/test/cypress/node_modules/blob-util/README.md +623 -0
- package/test/cypress/node_modules/bluebird/README.md +57 -0
- package/test/cypress/node_modules/brace-expansion/README.md +129 -0
- package/test/cypress/node_modules/buffer/README.md +410 -0
- package/test/cypress/node_modules/buffer-crc32/README.md +47 -0
- package/test/cypress/node_modules/cachedir/README.md +27 -0
- package/test/cypress/node_modules/caseless/README.md +45 -0
- package/test/cypress/node_modules/chalk/README.md +293 -0
- package/test/cypress/node_modules/chalk/node_modules/supports-color/README.md +76 -0
- package/test/cypress/node_modules/check-more-types/README.md +952 -0
- package/test/cypress/node_modules/ci-info/README.md +114 -0
- package/test/cypress/node_modules/clean-stack/README.md +76 -0
- package/test/cypress/node_modules/cli-cursor/README.md +55 -0
- package/test/cypress/node_modules/cli-table3/README.md +218 -0
- package/test/cypress/node_modules/cli-truncate/README.md +139 -0
- package/test/cypress/node_modules/color-convert/README.md +68 -0
- package/test/cypress/node_modules/color-name/README.md +11 -0
- package/test/cypress/node_modules/colorette/README.md +102 -0
- package/test/cypress/node_modules/colors/README.md +221 -0
- package/test/cypress/node_modules/combined-stream/README.md +138 -0
- package/test/cypress/node_modules/commander/README.md +737 -0
- package/test/cypress/node_modules/common-tags/README.md +687 -0
- package/test/cypress/node_modules/core-util-is/README.md +3 -0
- package/test/cypress/node_modules/cross-spawn/README.md +96 -0
- package/test/cypress/node_modules/cypress/README.md +25 -0
- package/test/cypress/node_modules/cypress/mount-utils/README.md +14 -0
- package/test/cypress/node_modules/cypress/react/README.md +414 -0
- package/test/cypress/node_modules/cypress/vue/README.md +678 -0
- package/test/cypress/node_modules/cypress/vue2/README.md +693 -0
- package/test/cypress/node_modules/dashdash/README.md +574 -0
- package/test/cypress/node_modules/dayjs/README.md +128 -0
- package/test/cypress/node_modules/debug/README.md +455 -0
- package/test/cypress/node_modules/delayed-stream/README.md +141 -0
- package/test/cypress/node_modules/ecc-jsbn/README.md +8 -0
- package/test/cypress/node_modules/emoji-regex/README.md +73 -0
- package/test/cypress/node_modules/end-of-stream/README.md +54 -0
- package/test/cypress/node_modules/enquirer/README.md +1752 -0
- package/test/cypress/node_modules/escape-string-regexp/README.md +27 -0
- package/test/cypress/node_modules/eventemitter2/README.md +809 -0
- package/test/cypress/node_modules/execa/README.md +656 -0
- package/test/cypress/node_modules/executable/README.md +64 -0
- package/test/cypress/node_modules/extend/README.md +81 -0
- package/test/cypress/node_modules/extract-zip/README.md +57 -0
- package/test/cypress/node_modules/extract-zip/node_modules/debug/README.md +455 -0
- package/test/cypress/node_modules/extsprintf/README.md +46 -0
- package/test/cypress/node_modules/fd-slicer/README.md +199 -0
- package/test/cypress/node_modules/figures/README.md +139 -0
- package/test/cypress/node_modules/forever-agent/README.md +4 -0
- package/test/cypress/node_modules/form-data/README.md +234 -0
- package/test/cypress/node_modules/fs-extra/README.md +264 -0
- package/test/cypress/node_modules/fs.realpath/README.md +33 -0
- package/test/cypress/node_modules/get-stream/README.md +124 -0
- package/test/cypress/node_modules/getos/README.md +79 -0
- package/test/cypress/node_modules/getpass/README.md +32 -0
- package/test/cypress/node_modules/glob/README.md +375 -0
- package/test/cypress/node_modules/global-dirs/README.md +72 -0
- package/test/cypress/node_modules/graceful-fs/README.md +133 -0
- package/test/cypress/node_modules/has-flag/README.md +89 -0
- package/test/cypress/node_modules/http-signature/README.md +80 -0
- package/test/cypress/node_modules/human-signals/README.md +155 -0
- package/test/cypress/node_modules/ieee754/README.md +51 -0
- package/test/cypress/node_modules/indent-string/README.md +70 -0
- package/test/cypress/node_modules/inflight/README.md +37 -0
- package/test/cypress/node_modules/inherits/README.md +42 -0
- package/test/cypress/node_modules/ini/README.md +102 -0
- package/test/cypress/node_modules/is-ci/README.md +50 -0
- package/test/cypress/node_modules/is-fullwidth-code-point/README.md +39 -0
- package/test/cypress/node_modules/is-installed-globally/README.md +31 -0
- package/test/cypress/node_modules/is-path-inside/README.md +63 -0
- package/test/cypress/node_modules/is-stream/README.md +57 -0
- package/test/cypress/node_modules/is-typedarray/README.md +16 -0
- package/test/cypress/node_modules/isexe/README.md +51 -0
- package/test/cypress/node_modules/isstream/README.md +66 -0
- package/test/cypress/node_modules/jsbn/README.md +175 -0
- package/test/cypress/node_modules/json-schema/README.md +3 -0
- package/test/cypress/node_modules/json-stringify-safe/README.md +52 -0
- package/test/cypress/node_modules/jsonfile/README.md +205 -0
- package/test/cypress/node_modules/jsonfile/node_modules/universalify/README.md +76 -0
- package/test/cypress/node_modules/jsprim/README.md +287 -0
- package/test/cypress/node_modules/lazy-ass/README.md +269 -0
- package/test/cypress/node_modules/listr2/README.md +17 -0
- package/test/cypress/node_modules/lodash/README.md +39 -0
- package/test/cypress/node_modules/lodash.once/README.md +18 -0
- package/test/cypress/node_modules/log-symbols/README.md +51 -0
- package/test/cypress/node_modules/log-update/README.md +97 -0
- package/test/cypress/node_modules/log-update/node_modules/slice-ansi/README.md +66 -0
- package/test/cypress/node_modules/log-update/node_modules/wrap-ansi/README.md +97 -0
- package/test/cypress/node_modules/lru-cache/README.md +166 -0
- package/test/cypress/node_modules/merge-stream/README.md +78 -0
- package/test/cypress/node_modules/mime-db/README.md +102 -0
- package/test/cypress/node_modules/mime-types/README.md +123 -0
- package/test/cypress/node_modules/mimic-fn/README.md +69 -0
- package/test/cypress/node_modules/minimatch/README.md +209 -0
- package/test/cypress/node_modules/ms/README.md +60 -0
- package/test/cypress/node_modules/npm-run-path/README.md +115 -0
- package/test/cypress/node_modules/once/README.md +79 -0
- package/test/cypress/node_modules/onetime/README.md +94 -0
- package/test/cypress/node_modules/ospath/README.md +53 -0
- package/test/cypress/node_modules/p-map/README.md +89 -0
- package/test/cypress/node_modules/path-is-absolute/README.md +59 -0
- package/test/cypress/node_modules/path-key/README.md +61 -0
- package/test/cypress/node_modules/pend/README.md +41 -0
- package/test/cypress/node_modules/performance-now/README.md +30 -0
- package/test/cypress/node_modules/pify/README.md +119 -0
- package/test/cypress/node_modules/pretty-bytes/README.md +131 -0
- package/test/cypress/node_modules/proxy-from-env/README.md +131 -0
- package/test/cypress/node_modules/psl/README.md +215 -0
- package/test/cypress/node_modules/pump/README.md +65 -0
- package/test/cypress/node_modules/punycode/README.md +122 -0
- package/test/cypress/node_modules/qs/README.md +475 -0
- package/test/cypress/node_modules/request-progress/README.md +78 -0
- package/test/cypress/node_modules/restore-cursor/README.md +26 -0
- package/test/cypress/node_modules/rimraf/README.md +101 -0
- package/test/cypress/node_modules/rxjs/README.md +147 -0
- package/test/cypress/node_modules/rxjs/_esm2015/README.md +147 -0
- package/test/cypress/node_modules/rxjs/_esm5/README.md +147 -0
- package/test/cypress/node_modules/rxjs/src/README.md +147 -0
- package/test/cypress/node_modules/safe-buffer/README.md +584 -0
- package/test/cypress/node_modules/safer-buffer/README.md +156 -0
- package/test/cypress/node_modules/semver/README.md +566 -0
- package/test/cypress/node_modules/shebang-command/README.md +34 -0
- package/test/cypress/node_modules/shebang-regex/README.md +33 -0
- package/test/cypress/node_modules/signal-exit/README.md +39 -0
- package/test/cypress/node_modules/slice-ansi/README.md +72 -0
- package/test/cypress/node_modules/sshpk/README.md +804 -0
- package/test/cypress/node_modules/string-width/README.md +50 -0
- package/test/cypress/node_modules/strip-ansi/README.md +46 -0
- package/test/cypress/node_modules/strip-final-newline/README.md +30 -0
- package/test/cypress/node_modules/supports-color/README.md +77 -0
- package/test/cypress/node_modules/throttleit/README.md +32 -0
- package/test/cypress/node_modules/tmp/README.md +365 -0
- package/test/cypress/node_modules/tough-cookie/README.md +527 -0
- package/test/cypress/node_modules/tslib/README.md +142 -0
- package/test/cypress/node_modules/tunnel-agent/README.md +4 -0
- package/test/cypress/node_modules/tweetnacl/README.md +459 -0
- package/test/cypress/node_modules/type-fest/README.md +760 -0
- package/test/cypress/node_modules/universalify/README.md +76 -0
- package/test/cypress/node_modules/untildify/README.md +30 -0
- package/test/cypress/node_modules/uuid/README.md +505 -0
- package/test/cypress/node_modules/verror/README.md +528 -0
- package/test/cypress/node_modules/verror/node_modules/extsprintf/README.md +46 -0
- package/test/cypress/node_modules/which/README.md +54 -0
- package/test/cypress/node_modules/wrap-ansi/README.md +91 -0
- package/test/cypress/node_modules/wrappy/README.md +36 -0
- package/test/cypress/node_modules/yallist/README.md +204 -0
- package/test/cypress/node_modules/yauzl/README.md +658 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# onetime [](https://travis-ci.com/github/sindresorhus/onetime)
|
|
2
|
+
|
|
3
|
+
> Ensure a function is only called once
|
|
4
|
+
|
|
5
|
+
When called multiple times it will return the return value from the first call.
|
|
6
|
+
|
|
7
|
+
*Unlike the module [once](https://github.com/isaacs/once), this one isn't naughty and extending `Function.prototype`.*
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
$ npm install onetime
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const onetime = require('onetime');
|
|
19
|
+
|
|
20
|
+
let i = 0;
|
|
21
|
+
|
|
22
|
+
const foo = onetime(() => ++i);
|
|
23
|
+
|
|
24
|
+
foo(); //=> 1
|
|
25
|
+
foo(); //=> 1
|
|
26
|
+
foo(); //=> 1
|
|
27
|
+
|
|
28
|
+
onetime.callCount(foo); //=> 3
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const onetime = require('onetime');
|
|
33
|
+
|
|
34
|
+
const foo = onetime(() => {}, {throw: true});
|
|
35
|
+
|
|
36
|
+
foo();
|
|
37
|
+
|
|
38
|
+
foo();
|
|
39
|
+
//=> Error: Function `foo` can only be called once
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## API
|
|
43
|
+
|
|
44
|
+
### onetime(fn, options?)
|
|
45
|
+
|
|
46
|
+
Returns a function that only calls `fn` once.
|
|
47
|
+
|
|
48
|
+
#### fn
|
|
49
|
+
|
|
50
|
+
Type: `Function`
|
|
51
|
+
|
|
52
|
+
Function that should only be called once.
|
|
53
|
+
|
|
54
|
+
#### options
|
|
55
|
+
|
|
56
|
+
Type: `object`
|
|
57
|
+
|
|
58
|
+
##### throw
|
|
59
|
+
|
|
60
|
+
Type: `boolean`\
|
|
61
|
+
Default: `false`
|
|
62
|
+
|
|
63
|
+
Throw an error when called more than once.
|
|
64
|
+
|
|
65
|
+
### onetime.callCount(fn)
|
|
66
|
+
|
|
67
|
+
Returns a number representing how many times `fn` has been called.
|
|
68
|
+
|
|
69
|
+
Note: It throws an error if you pass in a function that is not wrapped by `onetime`.
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
const onetime = require('onetime');
|
|
73
|
+
|
|
74
|
+
const foo = onetime(() => {});
|
|
75
|
+
|
|
76
|
+
foo();
|
|
77
|
+
foo();
|
|
78
|
+
foo();
|
|
79
|
+
|
|
80
|
+
console.log(onetime.callCount(foo));
|
|
81
|
+
//=> 3
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### fn
|
|
85
|
+
|
|
86
|
+
Type: `Function`
|
|
87
|
+
|
|
88
|
+
Function to get call count from.
|
|
89
|
+
|
|
90
|
+
## onetime for enterprise
|
|
91
|
+
|
|
92
|
+
Available as part of the Tidelift Subscription.
|
|
93
|
+
|
|
94
|
+
The maintainers of onetime and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-onetime?utm_source=npm-onetime&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
ospath
|
|
2
|
+
======
|
|
3
|
+
|
|
4
|
+
[](https://www.npmjs.org/package/ospath)
|
|
5
|
+
[](http://travis-ci.org/jprichardson/ospath)
|
|
6
|
+
|
|
7
|
+
A JavaScript component that provides operating specific path values.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Installation
|
|
11
|
+
------------
|
|
12
|
+
|
|
13
|
+
npm i --save ospath
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
API
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
### ospath.data()
|
|
20
|
+
|
|
21
|
+
Returns the directory where an application should store its data directory.
|
|
22
|
+
|
|
23
|
+
- **Windows**: `%APPDATA%`
|
|
24
|
+
- **OS X**: `~/Library/Application Support`
|
|
25
|
+
- **Unix-like**: `$XDG_CONFIG_HOME` or `~/.config`
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### ospath.desktop()
|
|
29
|
+
|
|
30
|
+
Returns the users desktop directory. On every OS, this is just the `home()`
|
|
31
|
+
dir and `Desktop`.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### ospath.home()
|
|
35
|
+
|
|
36
|
+
Returns the user's home directory.
|
|
37
|
+
|
|
38
|
+
- **Windows**: `%USERPROFILE%`
|
|
39
|
+
- **Unix-like**: `$HOME`
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### ospath.tmp()
|
|
43
|
+
|
|
44
|
+
Returns a temporary directory. Could also use `require('os').tmpdir()`.
|
|
45
|
+
|
|
46
|
+
- **Windows**: `%TEMP%`
|
|
47
|
+
- **Unix-like**: `/tmp`
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
License
|
|
51
|
+
-------
|
|
52
|
+
|
|
53
|
+
MIT
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# p-map [](https://travis-ci.org/sindresorhus/p-map)
|
|
2
|
+
|
|
3
|
+
> Map over promises concurrently
|
|
4
|
+
|
|
5
|
+
Useful when you need to run promise-returning & async functions multiple times with different inputs concurrently.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
$ npm install p-map
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const pMap = require('p-map');
|
|
17
|
+
const got = require('got');
|
|
18
|
+
|
|
19
|
+
const sites = [
|
|
20
|
+
getWebsiteFromUsername('https://sindresorhus'), //=> Promise
|
|
21
|
+
'https://ava.li',
|
|
22
|
+
'https://github.com'
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
(async () => {
|
|
26
|
+
const mapper = async site => {
|
|
27
|
+
const {requestUrl} = await got.head(site);
|
|
28
|
+
return requestUrl;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const result = await pMap(sites, mapper, {concurrency: 2});
|
|
32
|
+
|
|
33
|
+
console.log(result);
|
|
34
|
+
//=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/']
|
|
35
|
+
})();
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API
|
|
39
|
+
|
|
40
|
+
### pMap(input, mapper, options?)
|
|
41
|
+
|
|
42
|
+
Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order.
|
|
43
|
+
|
|
44
|
+
#### input
|
|
45
|
+
|
|
46
|
+
Type: `Iterable<Promise | unknown>`
|
|
47
|
+
|
|
48
|
+
Iterated over concurrently in the `mapper` function.
|
|
49
|
+
|
|
50
|
+
#### mapper(element, index)
|
|
51
|
+
|
|
52
|
+
Type: `Function`
|
|
53
|
+
|
|
54
|
+
Expected to return a `Promise` or value.
|
|
55
|
+
|
|
56
|
+
#### options
|
|
57
|
+
|
|
58
|
+
Type: `object`
|
|
59
|
+
|
|
60
|
+
##### concurrency
|
|
61
|
+
|
|
62
|
+
Type: `number` (Integer)\
|
|
63
|
+
Default: `Infinity`\
|
|
64
|
+
Minimum: `1`
|
|
65
|
+
|
|
66
|
+
Number of concurrently pending promises returned by `mapper`.
|
|
67
|
+
|
|
68
|
+
##### stopOnError
|
|
69
|
+
|
|
70
|
+
Type: `boolean`\
|
|
71
|
+
Default: `true`
|
|
72
|
+
|
|
73
|
+
When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises.
|
|
74
|
+
|
|
75
|
+
## p-map for enterprise
|
|
76
|
+
|
|
77
|
+
Available as part of the Tidelift Subscription.
|
|
78
|
+
|
|
79
|
+
The maintainers of p-map and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-p-map?utm_source=npm-p-map&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
80
|
+
|
|
81
|
+
## Related
|
|
82
|
+
|
|
83
|
+
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
|
|
84
|
+
- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently
|
|
85
|
+
- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently
|
|
86
|
+
- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object`
|
|
87
|
+
- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially
|
|
88
|
+
- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
|
|
89
|
+
- [More…](https://github.com/sindresorhus/promise-fun)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# path-is-absolute [](https://travis-ci.org/sindresorhus/path-is-absolute)
|
|
2
|
+
|
|
3
|
+
> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
$ npm install --save path-is-absolute
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const pathIsAbsolute = require('path-is-absolute');
|
|
17
|
+
|
|
18
|
+
// Running on Linux
|
|
19
|
+
pathIsAbsolute('/home/foo');
|
|
20
|
+
//=> true
|
|
21
|
+
pathIsAbsolute('C:/Users/foo');
|
|
22
|
+
//=> false
|
|
23
|
+
|
|
24
|
+
// Running on Windows
|
|
25
|
+
pathIsAbsolute('C:/Users/foo');
|
|
26
|
+
//=> true
|
|
27
|
+
pathIsAbsolute('/home/foo');
|
|
28
|
+
//=> false
|
|
29
|
+
|
|
30
|
+
// Running on any OS
|
|
31
|
+
pathIsAbsolute.posix('/home/foo');
|
|
32
|
+
//=> true
|
|
33
|
+
pathIsAbsolute.posix('C:/Users/foo');
|
|
34
|
+
//=> false
|
|
35
|
+
pathIsAbsolute.win32('C:/Users/foo');
|
|
36
|
+
//=> true
|
|
37
|
+
pathIsAbsolute.win32('/home/foo');
|
|
38
|
+
//=> false
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## API
|
|
43
|
+
|
|
44
|
+
See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
|
|
45
|
+
|
|
46
|
+
### pathIsAbsolute(path)
|
|
47
|
+
|
|
48
|
+
### pathIsAbsolute.posix(path)
|
|
49
|
+
|
|
50
|
+
POSIX specific version.
|
|
51
|
+
|
|
52
|
+
### pathIsAbsolute.win32(path)
|
|
53
|
+
|
|
54
|
+
Windows specific version.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# path-key [](https://travis-ci.org/sindresorhus/path-key)
|
|
2
|
+
|
|
3
|
+
> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform
|
|
4
|
+
|
|
5
|
+
It's usually `PATH`, but on Windows it can be any casing like `Path`...
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
$ npm install path-key
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const pathKey = require('path-key');
|
|
19
|
+
|
|
20
|
+
const key = pathKey();
|
|
21
|
+
//=> 'PATH'
|
|
22
|
+
|
|
23
|
+
const PATH = process.env[key];
|
|
24
|
+
//=> '/usr/local/bin:/usr/bin:/bin'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
### pathKey(options?)
|
|
31
|
+
|
|
32
|
+
#### options
|
|
33
|
+
|
|
34
|
+
Type: `object`
|
|
35
|
+
|
|
36
|
+
##### env
|
|
37
|
+
|
|
38
|
+
Type: `object`<br>
|
|
39
|
+
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env)
|
|
40
|
+
|
|
41
|
+
Use a custom environment variables object.
|
|
42
|
+
|
|
43
|
+
#### platform
|
|
44
|
+
|
|
45
|
+
Type: `string`<br>
|
|
46
|
+
Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform)
|
|
47
|
+
|
|
48
|
+
Get the PATH key for a specific platform.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
<div align="center">
|
|
54
|
+
<b>
|
|
55
|
+
<a href="https://tidelift.com/subscription/pkg/npm-path-key?utm_source=npm-path-key&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
56
|
+
</b>
|
|
57
|
+
<br>
|
|
58
|
+
<sub>
|
|
59
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
60
|
+
</sub>
|
|
61
|
+
</div>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Pend
|
|
2
|
+
|
|
3
|
+
Dead-simple optimistic async helper.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
var Pend = require('pend');
|
|
9
|
+
var pend = new Pend();
|
|
10
|
+
pend.max = 10; // defaults to Infinity
|
|
11
|
+
setTimeout(pend.hold(), 1000); // pend.wait will have to wait for this hold to finish
|
|
12
|
+
pend.go(function(cb) {
|
|
13
|
+
console.log("this function is immediately executed");
|
|
14
|
+
setTimeout(function() {
|
|
15
|
+
console.log("calling cb 1");
|
|
16
|
+
cb();
|
|
17
|
+
}, 500);
|
|
18
|
+
});
|
|
19
|
+
pend.go(function(cb) {
|
|
20
|
+
console.log("this function is also immediately executed");
|
|
21
|
+
setTimeout(function() {
|
|
22
|
+
console.log("calling cb 2");
|
|
23
|
+
cb();
|
|
24
|
+
}, 1000);
|
|
25
|
+
});
|
|
26
|
+
pend.wait(function(err) {
|
|
27
|
+
console.log("this is excuted when the first 2 have returned.");
|
|
28
|
+
console.log("err is a possible error in the standard callback style.");
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Output:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
this function is immediately executed
|
|
36
|
+
this function is also immediately executed
|
|
37
|
+
calling cb 1
|
|
38
|
+
calling cb 2
|
|
39
|
+
this is excuted when the first 2 have returned.
|
|
40
|
+
err is a possible error in the standard callback style.
|
|
41
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# performance-now [](https://travis-ci.org/braveg1rl/performance-now) [](https://david-dm.org/braveg1rl/performance-now)
|
|
2
|
+
|
|
3
|
+
Implements a function similar to `performance.now` (based on `process.hrtime`).
|
|
4
|
+
|
|
5
|
+
Modern browsers have a `window.performance` object with - among others - a `now` method which gives time in milliseconds, but with sub-millisecond precision. This module offers the same function based on the Node.js native `process.hrtime` function.
|
|
6
|
+
|
|
7
|
+
Using `process.hrtime` means that the reported time will be monotonically increasing, and not subject to clock-drift.
|
|
8
|
+
|
|
9
|
+
According to the [High Resolution Time specification](http://www.w3.org/TR/hr-time/), the number of milliseconds reported by `performance.now` should be relative to the value of `performance.timing.navigationStart`.
|
|
10
|
+
|
|
11
|
+
In the current version of the module (2.0) the reported time is relative to the time the current Node process has started (inferred from `process.uptime()`).
|
|
12
|
+
|
|
13
|
+
Version 1.0 reported a different time. The reported time was relative to the time the module was loaded (i.e. the time it was first `require`d). If you need this functionality, version 1.0 is still available on NPM.
|
|
14
|
+
|
|
15
|
+
## Example usage
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
var now = require("performance-now")
|
|
19
|
+
var start = now()
|
|
20
|
+
var end = now()
|
|
21
|
+
console.log(start.toFixed(3)) // the number of milliseconds the current node process is running
|
|
22
|
+
console.log((start-end).toFixed(3)) // ~ 0.002 on my system
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Running the now function two times right after each other yields a time difference of a few microseconds. Given this overhead, I think it's best to assume that the precision of intervals computed with this method is not higher than 10 microseconds, if you don't know the exact overhead on your own system.
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
performance-now is released under the [MIT License](http://opensource.org/licenses/MIT).
|
|
30
|
+
Copyright (c) 2017 Braveg1rl
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# pify [](https://travis-ci.org/sindresorhus/pify)
|
|
2
|
+
|
|
3
|
+
> Promisify a callback-style function
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
$ npm install --save pify
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const pify = require('pify');
|
|
18
|
+
|
|
19
|
+
// promisify a single function
|
|
20
|
+
|
|
21
|
+
pify(fs.readFile)('package.json', 'utf8').then(data => {
|
|
22
|
+
console.log(JSON.parse(data).name);
|
|
23
|
+
//=> 'pify'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// or promisify all methods in a module
|
|
27
|
+
|
|
28
|
+
pify(fs).readFile('package.json', 'utf8').then(data => {
|
|
29
|
+
console.log(JSON.parse(data).name);
|
|
30
|
+
//=> 'pify'
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## API
|
|
36
|
+
|
|
37
|
+
### pify(input, [promiseModule], [options])
|
|
38
|
+
|
|
39
|
+
Returns a promise wrapped version of the supplied function or module.
|
|
40
|
+
|
|
41
|
+
#### input
|
|
42
|
+
|
|
43
|
+
Type: `function`, `object`
|
|
44
|
+
|
|
45
|
+
Callback-style function or module whose methods you want to promisify.
|
|
46
|
+
|
|
47
|
+
#### promiseModule
|
|
48
|
+
|
|
49
|
+
Type: `function`
|
|
50
|
+
|
|
51
|
+
Custom promise module to use instead of the native one.
|
|
52
|
+
|
|
53
|
+
Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill.
|
|
54
|
+
|
|
55
|
+
#### options
|
|
56
|
+
|
|
57
|
+
##### multiArgs
|
|
58
|
+
|
|
59
|
+
Type: `boolean`
|
|
60
|
+
Default: `false`
|
|
61
|
+
|
|
62
|
+
By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument.
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
const request = require('request');
|
|
66
|
+
const pify = require('pify');
|
|
67
|
+
|
|
68
|
+
pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {
|
|
69
|
+
const [httpResponse, body] = result;
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
##### include
|
|
74
|
+
|
|
75
|
+
Type: `array` of (`string`|`regex`)
|
|
76
|
+
|
|
77
|
+
Methods in a module to promisify. Remaining methods will be left untouched.
|
|
78
|
+
|
|
79
|
+
##### exclude
|
|
80
|
+
|
|
81
|
+
Type: `array` of (`string`|`regex`)
|
|
82
|
+
Default: `[/.+Sync$/]`
|
|
83
|
+
|
|
84
|
+
Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.
|
|
85
|
+
|
|
86
|
+
##### excludeMain
|
|
87
|
+
|
|
88
|
+
Type: `boolean`
|
|
89
|
+
Default: `false`
|
|
90
|
+
|
|
91
|
+
By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module.
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
const pify = require('pify');
|
|
95
|
+
|
|
96
|
+
function fn() {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
fn.method = (data, callback) => {
|
|
101
|
+
setImmediate(() => {
|
|
102
|
+
callback(data, null);
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// promisify methods but not fn()
|
|
107
|
+
const promiseFn = pify(fn, {excludeMain: true});
|
|
108
|
+
|
|
109
|
+
if (promiseFn()) {
|
|
110
|
+
promiseFn.method('hi').then(data => {
|
|
111
|
+
console.log(data);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# pretty-bytes
|
|
2
|
+
|
|
3
|
+
> Convert bytes to a human readable string: `1337` → `1.34 kB`
|
|
4
|
+
|
|
5
|
+
Useful for displaying file sizes for humans.
|
|
6
|
+
|
|
7
|
+
*Note that it uses base-10 (e.g. kilobyte).
|
|
8
|
+
[Read about the difference between kilobyte and kibibyte.](https://web.archive.org/web/20150324153922/https://pacoup.com/2009/05/26/kb-kb-kib-whats-up-with-that/)*
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
$ npm install pretty-bytes
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
const prettyBytes = require('pretty-bytes');
|
|
20
|
+
|
|
21
|
+
prettyBytes(1337);
|
|
22
|
+
//=> '1.34 kB'
|
|
23
|
+
|
|
24
|
+
prettyBytes(100);
|
|
25
|
+
//=> '100 B'
|
|
26
|
+
|
|
27
|
+
// Display with units of bits
|
|
28
|
+
prettyBytes(1337, {bits: true});
|
|
29
|
+
//=> '1.34 kbit'
|
|
30
|
+
|
|
31
|
+
// Display file size differences
|
|
32
|
+
prettyBytes(42, {signed: true});
|
|
33
|
+
//=> '+42 B'
|
|
34
|
+
|
|
35
|
+
// Localized output using German locale
|
|
36
|
+
prettyBytes(1337, {locale: 'de'});
|
|
37
|
+
//=> '1,34 kB'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
### prettyBytes(number, options?)
|
|
43
|
+
|
|
44
|
+
#### number
|
|
45
|
+
|
|
46
|
+
Type: `number`
|
|
47
|
+
|
|
48
|
+
The number to format.
|
|
49
|
+
|
|
50
|
+
#### options
|
|
51
|
+
|
|
52
|
+
Type: `object`
|
|
53
|
+
|
|
54
|
+
##### signed
|
|
55
|
+
|
|
56
|
+
Type: `boolean`\
|
|
57
|
+
Default: `false`
|
|
58
|
+
|
|
59
|
+
Include plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.
|
|
60
|
+
|
|
61
|
+
##### bits
|
|
62
|
+
|
|
63
|
+
Type: `boolean`\
|
|
64
|
+
Default: `false`
|
|
65
|
+
|
|
66
|
+
Format the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).
|
|
67
|
+
|
|
68
|
+
##### binary
|
|
69
|
+
|
|
70
|
+
Type: `boolean`\
|
|
71
|
+
Default: `false`
|
|
72
|
+
|
|
73
|
+
Format the number using the [Binary Prefix](https://en.wikipedia.org/wiki/Binary_prefix) instead of the [SI Prefix](https://en.wikipedia.org/wiki/SI_prefix). This can be useful for presenting memory amounts. However, this should not be used for presenting file sizes.
|
|
74
|
+
|
|
75
|
+
##### locale
|
|
76
|
+
|
|
77
|
+
Type: `boolean | string`\
|
|
78
|
+
Default: `false` *(No localization)*
|
|
79
|
+
|
|
80
|
+
**Important:** Only the number and decimal separator are localized. The unit title is not and will not be localized.
|
|
81
|
+
|
|
82
|
+
- If `true`: Localize the output using the system/browser locale.
|
|
83
|
+
- If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
|
|
84
|
+
- If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
|
|
85
|
+
|
|
86
|
+
**Note:** Localization should generally work in browsers. Node.js needs to be [built](https://github.com/nodejs/node/wiki/Intl) with `full-icu` or `system-icu`. Alternatively, the [`full-icu`](https://github.com/unicode-org/full-icu-npm) module can be used to provide support at runtime. [Node.js 13](https://nodejs.org/en/blog/release/v13.0.0/) and later ships with ICU by default.
|
|
87
|
+
|
|
88
|
+
##### minimumFractionDigits
|
|
89
|
+
|
|
90
|
+
Type: `number`\
|
|
91
|
+
Default: `undefined`
|
|
92
|
+
|
|
93
|
+
The minimum number of fraction digits to display.
|
|
94
|
+
|
|
95
|
+
If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
const prettyBytes = require('pretty-bytes');
|
|
99
|
+
|
|
100
|
+
// Show the number with at least 3 fractional digits
|
|
101
|
+
prettyBytes(1900, {minimumFractionDigits: 3});
|
|
102
|
+
//=> '1.900 kB'
|
|
103
|
+
|
|
104
|
+
prettyBytes(1900);
|
|
105
|
+
//=> '1.9 kB'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
##### maximumFractionDigits
|
|
109
|
+
|
|
110
|
+
Type: `number`\
|
|
111
|
+
Default: `undefined`
|
|
112
|
+
|
|
113
|
+
The maximum number of fraction digits to display.
|
|
114
|
+
|
|
115
|
+
If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
const prettyBytes = require('pretty-bytes');
|
|
119
|
+
|
|
120
|
+
// Show the number with at most 1 fractional digit
|
|
121
|
+
prettyBytes(1920, {maximumFractionDigits: 1});
|
|
122
|
+
//=> '1.9 kB'
|
|
123
|
+
|
|
124
|
+
prettyBytes(1920);
|
|
125
|
+
//=> '1.92 kB'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Related
|
|
129
|
+
|
|
130
|
+
- [pretty-bytes-cli](https://github.com/sindresorhus/pretty-bytes-cli) - CLI for this module
|
|
131
|
+
- [pretty-ms](https://github.com/sindresorhus/pretty-ms) - Convert milliseconds to a human readable string
|