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,114 @@
|
|
|
1
|
+
# ci-info
|
|
2
|
+
|
|
3
|
+
Get details about the current Continuous Integration environment.
|
|
4
|
+
|
|
5
|
+
Please [open an
|
|
6
|
+
issue](https://github.com/watson/ci-info/issues/new?template=ci-server-not-detected.md)
|
|
7
|
+
if your CI server isn't properly detected :)
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/ci-info)
|
|
10
|
+
[](https://github.com/watson/ci-info/actions)
|
|
11
|
+
[](https://github.com/feross/standard)
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install ci-info --save
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
var ci = require('ci-info')
|
|
23
|
+
|
|
24
|
+
if (ci.isCI) {
|
|
25
|
+
console.log('The name of the CI server is:', ci.name)
|
|
26
|
+
} else {
|
|
27
|
+
console.log('This program is not running on a CI server')
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Supported CI tools
|
|
32
|
+
|
|
33
|
+
Officially supported CI servers:
|
|
34
|
+
|
|
35
|
+
| Name | Constant | isPR |
|
|
36
|
+
| ------------------------------------------------------------------------------- | -------------------- | ---- |
|
|
37
|
+
| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | 🚫 |
|
|
38
|
+
| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | ✅ |
|
|
39
|
+
| [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) | `ci.AZURE_PIPELINES` | ✅ |
|
|
40
|
+
| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | 🚫 |
|
|
41
|
+
| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | ✅ |
|
|
42
|
+
| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | ✅ |
|
|
43
|
+
| [Buddy](https://buddy.works/) | `ci.BUDDY` | ✅ |
|
|
44
|
+
| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | ✅ |
|
|
45
|
+
| [CircleCI](http://circleci.com) | `ci.CIRCLE` | ✅ |
|
|
46
|
+
| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | ✅ |
|
|
47
|
+
| [Codeship](https://codeship.com) | `ci.CODESHIP` | 🚫 |
|
|
48
|
+
| [Drone](https://drone.io) | `ci.DRONE` | ✅ |
|
|
49
|
+
| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | 🚫 |
|
|
50
|
+
| [GitHub Actions](https://github.com/features/actions/) | `ci.GITHUB_ACTIONS` | ✅ |
|
|
51
|
+
| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | ✅ |
|
|
52
|
+
| [GoCD](https://www.go.cd/) | `ci.GOCD` | 🚫 |
|
|
53
|
+
| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | 🚫 |
|
|
54
|
+
| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | ✅ |
|
|
55
|
+
| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | 🚫 |
|
|
56
|
+
| [Netlify CI](https://www.netlify.com/) | `ci.NETLIFY` | ✅ |
|
|
57
|
+
| [Nevercode](http://nevercode.io/) | `ci.NEVERCODE` | ✅ |
|
|
58
|
+
| [Render](https://render.com/) | `ci.RENDER` | ✅ |
|
|
59
|
+
| [Sail CI](https://sail.ci/) | `ci.SAIL` | ✅ |
|
|
60
|
+
| [Screwdriver](https://screwdriver.cd/) | `ci.SCREWDRIVER` | ✅ |
|
|
61
|
+
| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | ✅ |
|
|
62
|
+
| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | ✅ |
|
|
63
|
+
| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | ✅ |
|
|
64
|
+
| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | 🚫 |
|
|
65
|
+
| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | 🚫 |
|
|
66
|
+
| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | 🚫 |
|
|
67
|
+
| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | ✅ |
|
|
68
|
+
| [Vercel](https://vercel.com/) | `ci.VERCEL` | 🚫 |
|
|
69
|
+
| [Visual Studio App Center](https://appcenter.ms/) | `ci.APPCENTER` | 🚫 |
|
|
70
|
+
|
|
71
|
+
## API
|
|
72
|
+
|
|
73
|
+
### `ci.name`
|
|
74
|
+
|
|
75
|
+
Returns a string containing name of the CI server the code is running on.
|
|
76
|
+
If CI server is not detected, it returns `null`.
|
|
77
|
+
|
|
78
|
+
Don't depend on the value of this string not to change for a specific
|
|
79
|
+
vendor. If you find your self writing `ci.name === 'Travis CI'`, you
|
|
80
|
+
most likely want to use `ci.TRAVIS` instead.
|
|
81
|
+
|
|
82
|
+
### `ci.isCI`
|
|
83
|
+
|
|
84
|
+
Returns a boolean. Will be `true` if the code is running on a CI server,
|
|
85
|
+
otherwise `false`.
|
|
86
|
+
|
|
87
|
+
Some CI servers not listed here might still trigger the `ci.isCI`
|
|
88
|
+
boolean to be set to `true` if they use certain vendor neutral
|
|
89
|
+
environment variables. In those cases `ci.name` will be `null` and no
|
|
90
|
+
vendor specific boolean will be set to `true`.
|
|
91
|
+
|
|
92
|
+
### `ci.isPR`
|
|
93
|
+
|
|
94
|
+
Returns a boolean if PR detection is supported for the current CI server. Will
|
|
95
|
+
be `true` if a PR is being tested, otherwise `false`. If PR detection is
|
|
96
|
+
not supported for the current CI server, the value will be `null`.
|
|
97
|
+
|
|
98
|
+
### `ci.<VENDOR-CONSTANT>`
|
|
99
|
+
|
|
100
|
+
A vendor specific boolean constant is exposed for each support CI
|
|
101
|
+
vendor. A constant will be `true` if the code is determined to run on
|
|
102
|
+
the given CI server, otherwise `false`.
|
|
103
|
+
|
|
104
|
+
Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a
|
|
105
|
+
complete list, see the support table above.
|
|
106
|
+
|
|
107
|
+
Deprecated vendor constants that will be removed in the next major
|
|
108
|
+
release:
|
|
109
|
+
|
|
110
|
+
- `ci.TDDIUM` (Solano CI) This have been renamed `ci.SOLANO`
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# clean-stack [](https://travis-ci.org/sindresorhus/clean-stack)
|
|
2
|
+
|
|
3
|
+
> Clean up error stack traces
|
|
4
|
+
|
|
5
|
+
Removes the mostly unhelpful internal Node.js entries.
|
|
6
|
+
|
|
7
|
+
Also works in Electron.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
$ npm install clean-stack
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
const cleanStack = require('clean-stack');
|
|
21
|
+
|
|
22
|
+
const error = new Error('Missing unicorn');
|
|
23
|
+
|
|
24
|
+
console.log(error.stack);
|
|
25
|
+
/*
|
|
26
|
+
Error: Missing unicorn
|
|
27
|
+
at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
|
|
28
|
+
at Module._compile (module.js:409:26)
|
|
29
|
+
at Object.Module._extensions..js (module.js:416:10)
|
|
30
|
+
at Module.load (module.js:343:32)
|
|
31
|
+
at Function.Module._load (module.js:300:12)
|
|
32
|
+
at Function.Module.runMain (module.js:441:10)
|
|
33
|
+
at startup (node.js:139:18)
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
console.log(cleanStack(error.stack));
|
|
37
|
+
/*
|
|
38
|
+
Error: Missing unicorn
|
|
39
|
+
at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
|
|
40
|
+
*/
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## API
|
|
45
|
+
|
|
46
|
+
### cleanStack(stack, [options])
|
|
47
|
+
|
|
48
|
+
#### stack
|
|
49
|
+
|
|
50
|
+
Type: `string`
|
|
51
|
+
|
|
52
|
+
The `stack` property of an `Error`.
|
|
53
|
+
|
|
54
|
+
#### options
|
|
55
|
+
|
|
56
|
+
Type: `Object`
|
|
57
|
+
|
|
58
|
+
##### pretty
|
|
59
|
+
|
|
60
|
+
Type: `boolean`<br>
|
|
61
|
+
Default: `false`
|
|
62
|
+
|
|
63
|
+
Prettify the file paths in the stack:
|
|
64
|
+
|
|
65
|
+
`/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `~/dev/clean-stack/unicorn.js:2:15`
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## Related
|
|
69
|
+
|
|
70
|
+
- [extrack-stack](https://github.com/sindresorhus/extract-stack) - Extract the actual stack of an error
|
|
71
|
+
- [stack-utils](https://github.com/tapjs/stack-utils) - Captures and cleans stack traces
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# cli-cursor [](https://travis-ci.org/sindresorhus/cli-cursor)
|
|
2
|
+
|
|
3
|
+
> Toggle the CLI cursor
|
|
4
|
+
|
|
5
|
+
The cursor is [gracefully restored](https://github.com/sindresorhus/restore-cursor) if the process exits.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
$ npm install cli-cursor
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const cliCursor = require('cli-cursor');
|
|
19
|
+
|
|
20
|
+
cliCursor.hide();
|
|
21
|
+
|
|
22
|
+
const unicornsAreAwesome = true;
|
|
23
|
+
cliCursor.toggle(unicornsAreAwesome);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
### .show(stream?)
|
|
30
|
+
|
|
31
|
+
### .hide(stream?)
|
|
32
|
+
|
|
33
|
+
### .toggle(force?, stream?)
|
|
34
|
+
|
|
35
|
+
#### force
|
|
36
|
+
|
|
37
|
+
Useful for showing or hiding the cursor based on a boolean.
|
|
38
|
+
|
|
39
|
+
#### stream
|
|
40
|
+
|
|
41
|
+
Type: `stream.Writable`<br>
|
|
42
|
+
Default: `process.stderr`
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
<div align="center">
|
|
48
|
+
<b>
|
|
49
|
+
<a href="https://tidelift.com/subscription/pkg/npm-cli-cursor?utm_source=npm-cli-cursor&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
50
|
+
</b>
|
|
51
|
+
<br>
|
|
52
|
+
<sub>
|
|
53
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
54
|
+
</sub>
|
|
55
|
+
</div>
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
cli-table3
|
|
2
|
+
===============================================================================
|
|
3
|
+
|
|
4
|
+
[](https://www.npmjs.com/package/cli-table3)
|
|
5
|
+
[](https://travis-ci.com/cli-table/cli-table3)
|
|
6
|
+
|
|
7
|
+
This utility allows you to render unicode-aided tables on the command line from
|
|
8
|
+
your node.js scripts.
|
|
9
|
+
|
|
10
|
+
`cli-table3` is based on (and api compatible with) the original [cli-table](https://github.com/Automattic/cli-table),
|
|
11
|
+
and [cli-table2](https://github.com/jamestalmage/cli-table2), which are both
|
|
12
|
+
unmaintained. `cli-table3` includes all the additional features from
|
|
13
|
+
`cli-table2`.
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## Features not in the original cli-table
|
|
18
|
+
|
|
19
|
+
- Ability to make cells span columns and/or rows.
|
|
20
|
+
- Ability to set custom styles per cell (border characters/colors, padding, etc).
|
|
21
|
+
- Vertical alignment (top, bottom, center).
|
|
22
|
+
- Automatic word wrapping.
|
|
23
|
+
- More robust truncation of cell text that contains ansi color characters.
|
|
24
|
+
- Better handling of text color that spans multiple lines.
|
|
25
|
+
- API compatible with the original cli-table.
|
|
26
|
+
- Exhaustive test suite including the entire original cli-table test suite.
|
|
27
|
+
- Lots of examples auto-generated from the tests ([basic](https://github.com/cli-table/cli-table3/blob/master/basic-usage.md), [advanced](https://github.com/cli-table/cli-table3/blob/master/advanced-usage.md)).
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- Customizable characters that constitute the table.
|
|
32
|
+
- Color/background styling in the header through
|
|
33
|
+
[colors.js](https://github.com/marak/colors.js)
|
|
34
|
+
- Column width customization
|
|
35
|
+
- Text truncation based on predefined widths
|
|
36
|
+
- Text alignment (left, right, center)
|
|
37
|
+
- Padding (left, right)
|
|
38
|
+
- Easy-to-use API
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install cli-table3
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## How to use
|
|
47
|
+
|
|
48
|
+
A portion of the unit test suite is used to generate examples:
|
|
49
|
+
- [basic-usage](https://github.com/cli-table/cli-table3/blob/master/basic-usage.md) - covers basic uses.
|
|
50
|
+
- [advanced](https://github.com/cli-table/cli-table3/blob/master/advanced-usage.md) - covers using the new column and row span features.
|
|
51
|
+
|
|
52
|
+
This package is api compatible with the original [cli-table](https://github.com/Automattic/cli-table).
|
|
53
|
+
So all the original documentation still applies (copied below).
|
|
54
|
+
|
|
55
|
+
### Horizontal Tables
|
|
56
|
+
```javascript
|
|
57
|
+
var Table = require('cli-table3');
|
|
58
|
+
|
|
59
|
+
// instantiate
|
|
60
|
+
var table = new Table({
|
|
61
|
+
head: ['TH 1 label', 'TH 2 label']
|
|
62
|
+
, colWidths: [100, 200]
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// table is an Array, so you can `push`, `unshift`, `splice` and friends
|
|
66
|
+
table.push(
|
|
67
|
+
['First value', 'Second value']
|
|
68
|
+
, ['First value', 'Second value']
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
console.log(table.toString());
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Vertical Tables
|
|
75
|
+
```javascript
|
|
76
|
+
var Table = require('cli-table3');
|
|
77
|
+
var table = new Table();
|
|
78
|
+
|
|
79
|
+
table.push(
|
|
80
|
+
{ 'Some key': 'Some value' }
|
|
81
|
+
, { 'Another key': 'Another value' }
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
console.log(table.toString());
|
|
85
|
+
```
|
|
86
|
+
### Cross Tables
|
|
87
|
+
Cross tables are very similar to vertical tables, with two key differences:
|
|
88
|
+
|
|
89
|
+
1. They require a `head` setting when instantiated that has an empty string as the first header
|
|
90
|
+
2. The individual rows take the general form of { "Header": ["Row", "Values"] }
|
|
91
|
+
|
|
92
|
+
```javascript
|
|
93
|
+
var Table = require('cli-table3');
|
|
94
|
+
var table = new Table({ head: ["", "Top Header 1", "Top Header 2"] });
|
|
95
|
+
|
|
96
|
+
table.push(
|
|
97
|
+
{ 'Left Header 1': ['Value Row 1 Col 1', 'Value Row 1 Col 2'] }
|
|
98
|
+
, { 'Left Header 2': ['Value Row 2 Col 1', 'Value Row 2 Col 2'] }
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
console.log(table.toString());
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Custom styles
|
|
105
|
+
The ```chars``` property controls how the table is drawn:
|
|
106
|
+
```javascript
|
|
107
|
+
var table = new Table({
|
|
108
|
+
chars: { 'top': '═' , 'top-mid': '╤' , 'top-left': '╔' , 'top-right': '╗'
|
|
109
|
+
, 'bottom': '═' , 'bottom-mid': '╧' , 'bottom-left': '╚' , 'bottom-right': '╝'
|
|
110
|
+
, 'left': '║' , 'left-mid': '╟' , 'mid': '─' , 'mid-mid': '┼'
|
|
111
|
+
, 'right': '║' , 'right-mid': '╢' , 'middle': '│' }
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
table.push(
|
|
115
|
+
['foo', 'bar', 'baz']
|
|
116
|
+
, ['frob', 'bar', 'quuz']
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
console.log(table.toString());
|
|
120
|
+
// Outputs:
|
|
121
|
+
//
|
|
122
|
+
//╔══════╤═════╤══════╗
|
|
123
|
+
//║ foo │ bar │ baz ║
|
|
124
|
+
//╟──────┼─────┼──────╢
|
|
125
|
+
//║ frob │ bar │ quuz ║
|
|
126
|
+
//╚══════╧═════╧══════╝
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Empty decoration lines will be skipped, to avoid vertical separator rows just
|
|
130
|
+
set the 'mid', 'left-mid', 'mid-mid', 'right-mid' to the empty string:
|
|
131
|
+
```javascript
|
|
132
|
+
var table = new Table({ chars: {'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': ''} });
|
|
133
|
+
table.push(
|
|
134
|
+
['foo', 'bar', 'baz']
|
|
135
|
+
, ['frobnicate', 'bar', 'quuz']
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
console.log(table.toString());
|
|
139
|
+
// Outputs: (note the lack of the horizontal line between rows)
|
|
140
|
+
//┌────────────┬─────┬──────┐
|
|
141
|
+
//│ foo │ bar │ baz │
|
|
142
|
+
//│ frobnicate │ bar │ quuz │
|
|
143
|
+
//└────────────┴─────┴──────┘
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
By setting all chars to empty with the exception of 'middle' being set to a
|
|
147
|
+
single space and by setting padding to zero, it's possible to get the most
|
|
148
|
+
compact layout with no decorations:
|
|
149
|
+
```javascript
|
|
150
|
+
var table = new Table({
|
|
151
|
+
chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': ''
|
|
152
|
+
, 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': ''
|
|
153
|
+
, 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': ''
|
|
154
|
+
, 'right': '' , 'right-mid': '' , 'middle': ' ' },
|
|
155
|
+
style: { 'padding-left': 0, 'padding-right': 0 }
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
table.push(
|
|
159
|
+
['foo', 'bar', 'baz']
|
|
160
|
+
, ['frobnicate', 'bar', 'quuz']
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
console.log(table.toString());
|
|
164
|
+
// Outputs:
|
|
165
|
+
//foo bar baz
|
|
166
|
+
//frobnicate bar quuz
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Build Targets
|
|
170
|
+
|
|
171
|
+
Clone the repository and run `yarn install` to install all its submodules, then run one of the following commands:
|
|
172
|
+
|
|
173
|
+
###### Run the tests with coverage reports.
|
|
174
|
+
```bash
|
|
175
|
+
$ yarn test:coverage
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
###### Run the tests every time a file changes.
|
|
179
|
+
```bash
|
|
180
|
+
$ yarn test:watch
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
###### Update the documentation.
|
|
184
|
+
```bash
|
|
185
|
+
$ yarn docs
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Credits
|
|
189
|
+
|
|
190
|
+
- James Talmage - author <james.talmage@jrtechnical.com> ([jamestalmage](https://github.com/jamestalmage))
|
|
191
|
+
- Guillermo Rauch - author of the original cli-table <guillermo@learnboost.com> ([Rauchg](https://github.com/rauchg))
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
(The MIT License)
|
|
196
|
+
|
|
197
|
+
Copyright (c) 2014 James Talmage <james.talmage@jrtechnical.com>
|
|
198
|
+
|
|
199
|
+
Original cli-table code/documentation: Copyright (c) 2010 LearnBoost <dev@learnboost.com>
|
|
200
|
+
|
|
201
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
202
|
+
a copy of this software and associated documentation files (the
|
|
203
|
+
'Software'), to deal in the Software without restriction, including
|
|
204
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
205
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
206
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
207
|
+
the following conditions:
|
|
208
|
+
|
|
209
|
+
The above copyright notice and this permission notice shall be
|
|
210
|
+
included in all copies or substantial portions of the Software.
|
|
211
|
+
|
|
212
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
213
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
214
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
215
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
216
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
217
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
218
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# cli-truncate [](https://travis-ci.org/sindresorhus/cli-truncate)
|
|
2
|
+
|
|
3
|
+
> Truncate a string to a specific width in the terminal
|
|
4
|
+
|
|
5
|
+
Gracefully handles [ANSI escapes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles). Like a string styled with [`chalk`](https://github.com/chalk/chalk). It also supports Unicode surrogate pairs and fullwidth characters.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
$ npm install cli-truncate
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const cliTruncate = require('cli-truncate');
|
|
17
|
+
|
|
18
|
+
cliTruncate('unicorn', 4);
|
|
19
|
+
//=> 'uni…'
|
|
20
|
+
|
|
21
|
+
// Truncate at different positions
|
|
22
|
+
cliTruncate('unicorn', 4, {position: 'start'});
|
|
23
|
+
//=> '…orn'
|
|
24
|
+
|
|
25
|
+
cliTruncate('unicorn', 4, {position: 'middle'});
|
|
26
|
+
//=> 'un…n'
|
|
27
|
+
|
|
28
|
+
cliTruncate('unicorns rainbow dragons', 6, {position: 'end'})
|
|
29
|
+
//=> 'unico…'
|
|
30
|
+
|
|
31
|
+
cliTruncate('\u001B[31municorn\u001B[39m', 4);
|
|
32
|
+
//=> '\u001B[31muni\u001B[39m…'
|
|
33
|
+
|
|
34
|
+
// Truncate Unicode surrogate pairs
|
|
35
|
+
cliTruncate('uni\uD83C\uDE00corn', 5);
|
|
36
|
+
//=> 'uni\uD83C\uDE00…'
|
|
37
|
+
|
|
38
|
+
// Truncate fullwidth characters
|
|
39
|
+
cliTruncate('안녕하세요', 3);
|
|
40
|
+
//=> '안…'
|
|
41
|
+
|
|
42
|
+
// Truncate the paragraph to the terminal width
|
|
43
|
+
const paragraph = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.';
|
|
44
|
+
cliTruncate(paragraph, process.stdout.columns));
|
|
45
|
+
//=> 'Lorem ipsum dolor sit amet, consectetuer adipiscing…'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
### cliTruncate(text, columns, options?)
|
|
51
|
+
|
|
52
|
+
#### text
|
|
53
|
+
|
|
54
|
+
Type: `string`
|
|
55
|
+
|
|
56
|
+
Text to truncate.
|
|
57
|
+
|
|
58
|
+
#### columns
|
|
59
|
+
|
|
60
|
+
Type: `number`
|
|
61
|
+
|
|
62
|
+
Columns to occupy in the terminal.
|
|
63
|
+
|
|
64
|
+
#### options
|
|
65
|
+
|
|
66
|
+
Type: `object`
|
|
67
|
+
|
|
68
|
+
##### position
|
|
69
|
+
|
|
70
|
+
Type: `string`\
|
|
71
|
+
Default: `'end'`\
|
|
72
|
+
Values: `'start'` `'middle'` `'end'`
|
|
73
|
+
|
|
74
|
+
Position to truncate the string.
|
|
75
|
+
|
|
76
|
+
##### space
|
|
77
|
+
|
|
78
|
+
Type: `boolean`\
|
|
79
|
+
Default: `false`
|
|
80
|
+
|
|
81
|
+
Add a space between the text and the ellipsis.
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
cliTruncate('unicorns', 5, {space: false});
|
|
85
|
+
//=> 'unic…'
|
|
86
|
+
|
|
87
|
+
cliTruncate('unicorns', 5, {space: true});
|
|
88
|
+
//=> 'uni …'
|
|
89
|
+
|
|
90
|
+
cliTruncate('unicorns', 6, {position: 'start', space: true});
|
|
91
|
+
//=> '… orns'
|
|
92
|
+
|
|
93
|
+
cliTruncate('unicorns', 7, {position: 'middle', space: true});
|
|
94
|
+
//=> 'uni … s'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
##### preferTruncationOnSpace
|
|
98
|
+
|
|
99
|
+
Type: `boolean`\
|
|
100
|
+
Default: `false`
|
|
101
|
+
|
|
102
|
+
Truncate the string from a whitespace if it is within 3 characters from the actual breaking point.
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
cliTruncate('unicorns rainbow dragons', 20, {position: 'start', preferTruncationOnSpace: true})
|
|
106
|
+
//=> '…rainbow dragons'
|
|
107
|
+
|
|
108
|
+
// without preferTruncationOnSpace
|
|
109
|
+
cliTruncate('unicorns rainbow dragons', 20, {position: 'start'})
|
|
110
|
+
//=> '…rns rainbow dragons'
|
|
111
|
+
|
|
112
|
+
cliTruncate('unicorns rainbow dragons', 20, {position: 'middle', preferTruncationOnSpace: true})
|
|
113
|
+
//=> 'unicorns…dragons'
|
|
114
|
+
|
|
115
|
+
cliTruncate('unicorns rainbow dragons', 6, {position: 'end', preferTruncationOnSpace: true})
|
|
116
|
+
//=> 'unico…'
|
|
117
|
+
|
|
118
|
+
// preferTruncationOnSpace would have no effect if space isn't found within next 3 indexes
|
|
119
|
+
cliTruncate('unicorns rainbow dragons', 6, {position: 'middle', preferTruncationOnSpace: true})
|
|
120
|
+
//=> 'uni…ns'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Related
|
|
124
|
+
|
|
125
|
+
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
|
126
|
+
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
<div align="center">
|
|
132
|
+
<b>
|
|
133
|
+
<a href="https://tidelift.com/subscription/pkg/npm-cli-truncate?utm_source=npm-cli-truncate&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
134
|
+
</b>
|
|
135
|
+
<br>
|
|
136
|
+
<sub>
|
|
137
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
138
|
+
</sub>
|
|
139
|
+
</div>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# color-convert
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/Qix-/color-convert)
|
|
4
|
+
|
|
5
|
+
Color-convert is a color conversion library for JavaScript and node.
|
|
6
|
+
It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
var convert = require('color-convert');
|
|
10
|
+
|
|
11
|
+
convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
|
|
12
|
+
convert.keyword.rgb('blue'); // [0, 0, 255]
|
|
13
|
+
|
|
14
|
+
var rgbChannels = convert.rgb.channels; // 3
|
|
15
|
+
var cmykChannels = convert.cmyk.channels; // 4
|
|
16
|
+
var ansiChannels = convert.ansi16.channels; // 1
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
# Install
|
|
20
|
+
|
|
21
|
+
```console
|
|
22
|
+
$ npm install color-convert
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
# API
|
|
26
|
+
|
|
27
|
+
Simply get the property of the _from_ and _to_ conversion that you're looking for.
|
|
28
|
+
|
|
29
|
+
All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
|
|
30
|
+
|
|
31
|
+
All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
var convert = require('color-convert');
|
|
35
|
+
|
|
36
|
+
// Hex to LAB
|
|
37
|
+
convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
|
|
38
|
+
convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
|
|
39
|
+
|
|
40
|
+
// RGB to CMYK
|
|
41
|
+
convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ]
|
|
42
|
+
convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Arrays
|
|
46
|
+
All functions that accept multiple arguments also support passing an array.
|
|
47
|
+
|
|
48
|
+
Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
var convert = require('color-convert');
|
|
52
|
+
|
|
53
|
+
convert.rgb.hex(123, 45, 67); // '7B2D43'
|
|
54
|
+
convert.rgb.hex([123, 45, 67]); // '7B2D43'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Routing
|
|
58
|
+
|
|
59
|
+
Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
|
|
60
|
+
|
|
61
|
+
Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
|
|
62
|
+
|
|
63
|
+
# Contribute
|
|
64
|
+
|
|
65
|
+
If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
|
|
66
|
+
|
|
67
|
+
# License
|
|
68
|
+
Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
|
|
2
|
+
|
|
3
|
+
[](https://nodei.co/npm/color-name/)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
```js
|
|
7
|
+
var colors = require('color-name');
|
|
8
|
+
colors.red //[255,0,0]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>
|