ali-skills 0.0.21 → 0.0.22
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/node_modules/@ali/cli-skills/dist/cli.mjs +1214 -287
- package/node_modules/@ali/cli-skills/package.json +5 -2
- package/node_modules/@ali/o2-open-client/.editorconfig +11 -0
- package/node_modules/@ali/o2-open-client/README.md +80 -0
- package/node_modules/@ali/o2-open-client/abc.json +8 -0
- package/node_modules/@ali/o2-open-client/es/browser/ee.d.ts +23 -0
- package/node_modules/@ali/o2-open-client/es/browser/ee.js +82 -0
- package/node_modules/@ali/o2-open-client/es/browser/entry.d.ts +32 -0
- package/node_modules/@ali/o2-open-client/es/browser/entry.js +306 -0
- package/node_modules/@ali/o2-open-client/es/browser/escape.d.ts +12 -0
- package/node_modules/@ali/o2-open-client/es/browser/escape.js +178 -0
- package/node_modules/@ali/o2-open-client/es/browser/fetch.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/browser/fetch.js +14 -0
- package/node_modules/@ali/o2-open-client/es/browser/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/browser/index.js +1 -0
- package/node_modules/@ali/o2-open-client/es/common/constant.d.ts +42 -0
- package/node_modules/@ali/o2-open-client/es/common/constant.js +53 -0
- package/node_modules/@ali/o2-open-client/es/common/format.d.ts +14 -0
- package/node_modules/@ali/o2-open-client/es/common/format.js +43 -0
- package/node_modules/@ali/o2-open-client/es/common/service-meta.d.ts +33 -0
- package/node_modules/@ali/o2-open-client/es/common/service-meta.js +33 -0
- package/node_modules/@ali/o2-open-client/es/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/index.js +8 -0
- package/node_modules/@ali/o2-open-client/es/node/config.d.ts +47 -0
- package/node_modules/@ali/o2-open-client/es/node/config.js +188 -0
- package/node_modules/@ali/o2-open-client/es/node/escape.d.ts +22 -0
- package/node_modules/@ali/o2-open-client/es/node/escape.js +131 -0
- package/node_modules/@ali/o2-open-client/es/node/help.d.ts +10 -0
- package/node_modules/@ali/o2-open-client/es/node/help.js +96 -0
- package/node_modules/@ali/o2-open-client/es/node/index.d.ts +48 -0
- package/node_modules/@ali/o2-open-client/es/node/index.js +247 -0
- package/node_modules/@ali/o2-open-client/es/node/token-handler.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/node/token-handler.js +21 -0
- package/node_modules/@ali/o2-open-client/lib/browser/ee.d.ts +23 -0
- package/node_modules/@ali/o2-open-client/lib/browser/ee.js +86 -0
- package/node_modules/@ali/o2-open-client/lib/browser/entry.d.ts +32 -0
- package/node_modules/@ali/o2-open-client/lib/browser/entry.js +310 -0
- package/node_modules/@ali/o2-open-client/lib/browser/escape.d.ts +12 -0
- package/node_modules/@ali/o2-open-client/lib/browser/escape.js +185 -0
- package/node_modules/@ali/o2-open-client/lib/browser/fetch.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/browser/fetch.js +18 -0
- package/node_modules/@ali/o2-open-client/lib/common/constant.d.ts +42 -0
- package/node_modules/@ali/o2-open-client/lib/common/constant.js +56 -0
- package/node_modules/@ali/o2-open-client/lib/common/format.d.ts +14 -0
- package/node_modules/@ali/o2-open-client/lib/common/format.js +48 -0
- package/node_modules/@ali/o2-open-client/lib/common/service-meta.d.ts +33 -0
- package/node_modules/@ali/o2-open-client/lib/common/service-meta.js +36 -0
- package/node_modules/@ali/o2-open-client/lib/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/index.js +20 -0
- package/node_modules/@ali/o2-open-client/lib/node/config.d.ts +47 -0
- package/node_modules/@ali/o2-open-client/lib/node/config.js +192 -0
- package/node_modules/@ali/o2-open-client/lib/node/escape.d.ts +22 -0
- package/node_modules/@ali/o2-open-client/lib/node/escape.js +137 -0
- package/node_modules/@ali/o2-open-client/lib/node/help.d.ts +10 -0
- package/node_modules/@ali/o2-open-client/lib/node/help.js +100 -0
- package/node_modules/@ali/o2-open-client/lib/node/index.d.ts +48 -0
- package/node_modules/@ali/o2-open-client/lib/node/index.js +250 -0
- package/node_modules/@ali/o2-open-client/lib/node/token-handler.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/node/token-handler.js +25 -0
- package/node_modules/@ali/o2-open-client/package.json +46 -0
- package/node_modules/@ali/o2-open-client/playwright.config.ts +54 -0
- package/node_modules/@ali/o2-open-client/tsconfig.es.json +31 -0
- package/node_modules/@ali/o2-open-client/tsconfig.json +31 -0
- package/node_modules/@ali/o2-open-client/tsx2doc.config.js +5 -0
- package/node_modules/@ali/o2-open-client/typings/index.d.ts +36 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/node/assert.d.ts +1062 -0
- package/node_modules/@types/node/async_hooks.d.ts +605 -0
- package/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/node_modules/@types/node/buffer.d.ts +1936 -0
- package/node_modules/@types/node/child_process.d.ts +1475 -0
- package/node_modules/@types/node/cluster.d.ts +577 -0
- package/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/node/console.d.ts +452 -0
- package/node_modules/@types/node/constants.d.ts +21 -0
- package/node_modules/@types/node/crypto.d.ts +4590 -0
- package/node_modules/@types/node/dgram.d.ts +597 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/node_modules/@types/node/dns/promises.d.ts +479 -0
- package/node_modules/@types/node/dns.d.ts +871 -0
- package/node_modules/@types/node/domain.d.ts +170 -0
- package/node_modules/@types/node/events.d.ts +977 -0
- package/node_modules/@types/node/fs/promises.d.ts +1270 -0
- package/node_modules/@types/node/fs.d.ts +4375 -0
- package/node_modules/@types/node/globals.d.ts +172 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/node_modules/@types/node/http.d.ts +2049 -0
- package/node_modules/@types/node/http2.d.ts +2631 -0
- package/node_modules/@types/node/https.d.ts +578 -0
- package/node_modules/@types/node/index.d.ts +93 -0
- package/node_modules/@types/node/inspector.generated.d.ts +3966 -0
- package/node_modules/@types/node/module.d.ts +539 -0
- package/node_modules/@types/node/net.d.ts +1031 -0
- package/node_modules/@types/node/os.d.ts +506 -0
- package/node_modules/@types/node/package.json +140 -0
- package/node_modules/@types/node/path.d.ts +200 -0
- package/node_modules/@types/node/perf_hooks.d.ts +961 -0
- package/node_modules/@types/node/process.d.ts +1961 -0
- package/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/node/querystring.d.ts +152 -0
- package/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/node_modules/@types/node/readline.d.ts +589 -0
- package/node_modules/@types/node/repl.d.ts +430 -0
- package/node_modules/@types/node/sea.d.ts +153 -0
- package/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/node_modules/@types/node/stream/web.d.ts +533 -0
- package/node_modules/@types/node/stream.d.ts +1698 -0
- package/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/node/test.d.ts +1787 -0
- package/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/node_modules/@types/node/timers.d.ts +286 -0
- package/node_modules/@types/node/tls.d.ts +1259 -0
- package/node_modules/@types/node/trace_events.d.ts +197 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +93 -0
- package/node_modules/@types/node/tty.d.ts +208 -0
- package/node_modules/@types/node/url.d.ts +964 -0
- package/node_modules/@types/node/util.d.ts +2331 -0
- package/node_modules/@types/node/v8.d.ts +809 -0
- package/node_modules/@types/node/vm.d.ts +1001 -0
- package/node_modules/@types/node/wasi.d.ts +181 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/node_modules/@types/node/worker_threads.d.ts +715 -0
- package/node_modules/@types/node/zlib.d.ts +598 -0
- package/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/await-event/LICENSE +22 -0
- package/node_modules/await-event/README.md +48 -0
- package/node_modules/await-event/index.js +13 -0
- package/node_modules/await-event/package.json +33 -0
- package/node_modules/await-first/LICENSE +21 -0
- package/node_modules/await-first/README.md +80 -0
- package/node_modules/await-first/lib/index.js +21 -0
- package/node_modules/await-first/package.json +49 -0
- package/node_modules/byte/LICENSE.txt +21 -0
- package/node_modules/byte/README.md +207 -0
- package/node_modules/byte/lib/byte.js +635 -0
- package/node_modules/byte/lib/number.js +82 -0
- package/node_modules/byte/package.json +61 -0
- package/node_modules/chalk/index.d.ts +415 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +68 -0
- package/node_modules/chalk/readme.md +341 -0
- package/node_modules/chalk/source/index.js +229 -0
- package/node_modules/chalk/source/templates.js +134 -0
- package/node_modules/chalk/source/util.js +39 -0
- package/node_modules/circular-json-for-egg/LICENSE.txt +19 -0
- package/node_modules/circular-json-for-egg/README.md +148 -0
- package/node_modules/circular-json-for-egg/build/circular-json.amd.js +2 -0
- package/node_modules/circular-json-for-egg/build/circular-json.js +2 -0
- package/node_modules/circular-json-for-egg/build/circular-json.max.amd.js +210 -0
- package/node_modules/circular-json-for-egg/build/circular-json.max.js +210 -0
- package/node_modules/circular-json-for-egg/build/circular-json.node.js +207 -0
- package/node_modules/circular-json-for-egg/package.json +42 -0
- package/node_modules/cluster-client/LICENSE +21 -0
- package/node_modules/cluster-client/README.md +319 -0
- package/node_modules/cluster-client/index.js +66 -0
- package/node_modules/cluster-client/lib/api_client.js +74 -0
- package/node_modules/cluster-client/lib/connection.js +180 -0
- package/node_modules/cluster-client/lib/const.js +5 -0
- package/node_modules/cluster-client/lib/default_logger.js +11 -0
- package/node_modules/cluster-client/lib/default_transcode.js +6 -0
- package/node_modules/cluster-client/lib/follower.js +331 -0
- package/node_modules/cluster-client/lib/index.js +213 -0
- package/node_modules/cluster-client/lib/leader.js +437 -0
- package/node_modules/cluster-client/lib/protocol/byte_buffer.js +8 -0
- package/node_modules/cluster-client/lib/protocol/packet.js +103 -0
- package/node_modules/cluster-client/lib/protocol/request.js +17 -0
- package/node_modules/cluster-client/lib/protocol/response.js +14 -0
- package/node_modules/cluster-client/lib/server.js +256 -0
- package/node_modules/cluster-client/lib/symbol.js +20 -0
- package/node_modules/cluster-client/lib/utils.js +103 -0
- package/node_modules/cluster-client/lib/wrapper/base.js +210 -0
- package/node_modules/cluster-client/lib/wrapper/cluster.js +57 -0
- package/node_modules/cluster-client/lib/wrapper/single.js +192 -0
- package/node_modules/cluster-client/package.json +60 -0
- package/node_modules/co/LICENSE +22 -0
- package/node_modules/co/Readme.md +212 -0
- package/node_modules/co/index.js +237 -0
- package/node_modules/co/package.json +34 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +839 -0
- package/node_modules/color-convert/index.js +81 -0
- package/node_modules/color-convert/package.json +48 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +28 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/depd/History.md +103 -0
- package/node_modules/depd/LICENSE +22 -0
- package/node_modules/depd/Readme.md +280 -0
- package/node_modules/depd/index.js +538 -0
- package/node_modules/depd/lib/browser/index.js +77 -0
- package/node_modules/depd/package.json +45 -0
- package/node_modules/ee-first/LICENSE +22 -0
- package/node_modules/ee-first/README.md +80 -0
- package/node_modules/ee-first/index.js +95 -0
- package/node_modules/ee-first/package.json +29 -0
- package/node_modules/egg-errors/LICENSE +21 -0
- package/node_modules/egg-errors/README.md +259 -0
- package/node_modules/egg-errors/lib/base.d.ts +10 -0
- package/node_modules/egg-errors/lib/base.js +28 -0
- package/node_modules/egg-errors/lib/base_error.d.ts +6 -0
- package/node_modules/egg-errors/lib/base_error.js +13 -0
- package/node_modules/egg-errors/lib/base_exception.d.ts +6 -0
- package/node_modules/egg-errors/lib/base_exception.js +13 -0
- package/node_modules/egg-errors/lib/error.d.ts +6 -0
- package/node_modules/egg-errors/lib/error.js +13 -0
- package/node_modules/egg-errors/lib/error_options.d.ts +5 -0
- package/node_modules/egg-errors/lib/error_options.js +6 -0
- package/node_modules/egg-errors/lib/error_type.d.ts +6 -0
- package/node_modules/egg-errors/lib/error_type.js +10 -0
- package/node_modules/egg-errors/lib/exception.d.ts +6 -0
- package/node_modules/egg-errors/lib/exception.js +13 -0
- package/node_modules/egg-errors/lib/framework/formatter.d.ts +6 -0
- package/node_modules/egg-errors/lib/framework/formatter.js +29 -0
- package/node_modules/egg-errors/lib/framework/framework_base_error.d.ts +10 -0
- package/node_modules/egg-errors/lib/framework/framework_base_error.js +32 -0
- package/node_modules/egg-errors/lib/http/400.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/400.js +13 -0
- package/node_modules/egg-errors/lib/http/401.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/401.js +13 -0
- package/node_modules/egg-errors/lib/http/402.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/402.js +13 -0
- package/node_modules/egg-errors/lib/http/403.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/403.js +13 -0
- package/node_modules/egg-errors/lib/http/404.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/404.js +13 -0
- package/node_modules/egg-errors/lib/http/405.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/405.js +13 -0
- package/node_modules/egg-errors/lib/http/406.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/406.js +13 -0
- package/node_modules/egg-errors/lib/http/407.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/407.js +13 -0
- package/node_modules/egg-errors/lib/http/408.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/408.js +13 -0
- package/node_modules/egg-errors/lib/http/409.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/409.js +13 -0
- package/node_modules/egg-errors/lib/http/410.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/410.js +13 -0
- package/node_modules/egg-errors/lib/http/411.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/411.js +13 -0
- package/node_modules/egg-errors/lib/http/412.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/412.js +13 -0
- package/node_modules/egg-errors/lib/http/413.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/413.js +13 -0
- package/node_modules/egg-errors/lib/http/414.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/414.js +13 -0
- package/node_modules/egg-errors/lib/http/415.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/415.js +13 -0
- package/node_modules/egg-errors/lib/http/416.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/416.js +13 -0
- package/node_modules/egg-errors/lib/http/417.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/417.js +13 -0
- package/node_modules/egg-errors/lib/http/418.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/418.js +13 -0
- package/node_modules/egg-errors/lib/http/421.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/421.js +13 -0
- package/node_modules/egg-errors/lib/http/422.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/422.js +13 -0
- package/node_modules/egg-errors/lib/http/423.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/423.js +13 -0
- package/node_modules/egg-errors/lib/http/424.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/424.js +13 -0
- package/node_modules/egg-errors/lib/http/425.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/425.js +13 -0
- package/node_modules/egg-errors/lib/http/426.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/426.js +13 -0
- package/node_modules/egg-errors/lib/http/428.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/428.js +13 -0
- package/node_modules/egg-errors/lib/http/429.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/429.js +13 -0
- package/node_modules/egg-errors/lib/http/431.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/431.js +13 -0
- package/node_modules/egg-errors/lib/http/451.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/451.js +13 -0
- package/node_modules/egg-errors/lib/http/500.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/500.js +13 -0
- package/node_modules/egg-errors/lib/http/501.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/501.js +13 -0
- package/node_modules/egg-errors/lib/http/502.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/502.js +13 -0
- package/node_modules/egg-errors/lib/http/503.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/503.js +13 -0
- package/node_modules/egg-errors/lib/http/504.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/504.js +13 -0
- package/node_modules/egg-errors/lib/http/505.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/505.js +13 -0
- package/node_modules/egg-errors/lib/http/506.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/506.js +13 -0
- package/node_modules/egg-errors/lib/http/507.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/507.js +13 -0
- package/node_modules/egg-errors/lib/http/508.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/508.js +13 -0
- package/node_modules/egg-errors/lib/http/509.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/509.js +13 -0
- package/node_modules/egg-errors/lib/http/510.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/510.js +13 -0
- package/node_modules/egg-errors/lib/http/511.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/511.js +13 -0
- package/node_modules/egg-errors/lib/http/http_error.d.ts +10 -0
- package/node_modules/egg-errors/lib/http/http_error.js +13 -0
- package/node_modules/egg-errors/lib/http/http_error_options.d.ts +6 -0
- package/node_modules/egg-errors/lib/http/http_error_options.js +7 -0
- package/node_modules/egg-errors/lib/http/http_header.d.ts +3 -0
- package/node_modules/egg-errors/lib/http/http_header.js +3 -0
- package/node_modules/egg-errors/lib/index.d.ts +50 -0
- package/node_modules/egg-errors/lib/index.js +149 -0
- package/node_modules/egg-errors/package.json +49 -0
- package/node_modules/egg-logger/LICENSE +21 -0
- package/node_modules/egg-logger/README.md +128 -0
- package/node_modules/egg-logger/README.zh-CN.md +125 -0
- package/node_modules/egg-logger/index.d.ts +233 -0
- package/node_modules/egg-logger/index.js +18 -0
- package/node_modules/egg-logger/lib/egg/console_logger.js +36 -0
- package/node_modules/egg-logger/lib/egg/context_logger.js +43 -0
- package/node_modules/egg-logger/lib/egg/custom_logger.js +10 -0
- package/node_modules/egg-logger/lib/egg/error_logger.js +31 -0
- package/node_modules/egg-logger/lib/egg/logger.js +128 -0
- package/node_modules/egg-logger/lib/egg/loggers.js +163 -0
- package/node_modules/egg-logger/lib/level.js +34 -0
- package/node_modules/egg-logger/lib/logger.js +170 -0
- package/node_modules/egg-logger/lib/transports/console.js +52 -0
- package/node_modules/egg-logger/lib/transports/file.js +134 -0
- package/node_modules/egg-logger/lib/transports/file_buffer.js +113 -0
- package/node_modules/egg-logger/lib/transports/transport.js +129 -0
- package/node_modules/egg-logger/lib/utils.js +296 -0
- package/node_modules/egg-logger/package.json +54 -0
- package/node_modules/escape-html/LICENSE +24 -0
- package/node_modules/escape-html/Readme.md +43 -0
- package/node_modules/escape-html/index.js +78 -0
- package/node_modules/escape-html/package.json +24 -0
- package/node_modules/extend-shallow/LICENSE +21 -0
- package/node_modules/extend-shallow/README.md +61 -0
- package/node_modules/extend-shallow/index.js +33 -0
- package/node_modules/extend-shallow/package.json +56 -0
- package/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +46 -0
- package/node_modules/has-flag/readme.md +89 -0
- package/node_modules/heartbeats/.eslintrc +151 -0
- package/node_modules/heartbeats/.npmignore +28 -0
- package/node_modules/heartbeats/.travis.yml +10 -0
- package/node_modules/heartbeats/LICENSE +21 -0
- package/node_modules/heartbeats/README.md +323 -0
- package/node_modules/heartbeats/lib/beatevent.js +35 -0
- package/node_modules/heartbeats/lib/heart.js +178 -0
- package/node_modules/heartbeats/lib/pulse.js +39 -0
- package/node_modules/heartbeats/main.js +34 -0
- package/node_modules/heartbeats/package.json +39 -0
- package/node_modules/heartbeats/test/benchmark.js +138 -0
- package/node_modules/heartbeats/test/spawn.js +16 -0
- package/node_modules/heartbeats/test/test.js +158 -0
- package/node_modules/httpx/README.md +96 -0
- package/node_modules/httpx/lib/index.d.ts +31 -0
- package/node_modules/httpx/lib/index.js +396 -0
- package/node_modules/httpx/package.json +36 -0
- package/node_modules/iconv-lite/.github/dependabot.yml +11 -0
- package/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
- package/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
- package/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/node_modules/iconv-lite/.idea/modules.xml +8 -0
- package/node_modules/iconv-lite/.idea/vcs.xml +6 -0
- package/node_modules/iconv-lite/Changelog.md +212 -0
- package/node_modules/iconv-lite/LICENSE +21 -0
- package/node_modules/iconv-lite/README.md +130 -0
- package/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
- package/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
- package/node_modules/iconv-lite/encodings/index.js +23 -0
- package/node_modules/iconv-lite/encodings/internal.js +198 -0
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
- package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/node_modules/iconv-lite/encodings/utf16.js +197 -0
- package/node_modules/iconv-lite/encodings/utf32.js +319 -0
- package/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/node_modules/iconv-lite/lib/index.d.ts +41 -0
- package/node_modules/iconv-lite/lib/index.js +180 -0
- package/node_modules/iconv-lite/lib/streams.js +109 -0
- package/node_modules/iconv-lite/package.json +44 -0
- package/node_modules/ip/README.md +90 -0
- package/node_modules/ip/lib/ip.js +496 -0
- package/node_modules/ip/package.json +25 -0
- package/node_modules/is-class-hotfix/.editorconfig +23 -0
- package/node_modules/is-class-hotfix/.gitattributes +2 -0
- package/node_modules/is-class-hotfix/CHANGELOG.md +7 -0
- package/node_modules/is-class-hotfix/LICENSE.md +21 -0
- package/node_modules/is-class-hotfix/README.md +35 -0
- package/node_modules/is-class-hotfix/bower.json +24 -0
- package/node_modules/is-class-hotfix/is-class.js +28 -0
- package/node_modules/is-class-hotfix/package.json +31 -0
- package/node_modules/is-class-hotfix/test/babel-class.js +27 -0
- package/node_modules/is-class-hotfix/test/is-class.js +31 -0
- package/node_modules/is-extendable/LICENSE +21 -0
- package/node_modules/is-extendable/README.md +72 -0
- package/node_modules/is-extendable/index.js +13 -0
- package/node_modules/is-extendable/package.json +51 -0
- package/node_modules/is-type-of/LICENSE +21 -0
- package/node_modules/is-type-of/README.md +105 -0
- package/node_modules/is-type-of/index.d.ts +65 -0
- package/node_modules/is-type-of/index.js +125 -0
- package/node_modules/is-type-of/package.json +45 -0
- package/node_modules/isstream/.jshintrc +59 -0
- package/node_modules/isstream/.npmignore +1 -0
- package/node_modules/isstream/.travis.yml +12 -0
- package/node_modules/isstream/LICENSE.md +11 -0
- package/node_modules/isstream/README.md +66 -0
- package/node_modules/isstream/isstream.js +27 -0
- package/node_modules/isstream/package.json +33 -0
- package/node_modules/isstream/test.js +168 -0
- package/node_modules/json-stringify-safe/.npmignore +1 -0
- package/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
- package/node_modules/json-stringify-safe/LICENSE +15 -0
- package/node_modules/json-stringify-safe/Makefile +35 -0
- package/node_modules/json-stringify-safe/README.md +52 -0
- package/node_modules/json-stringify-safe/package.json +31 -0
- package/node_modules/json-stringify-safe/stringify.js +27 -0
- package/node_modules/json-stringify-safe/test/mocha.opts +2 -0
- package/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
- package/node_modules/kitx/LICENSE +21 -0
- package/node_modules/kitx/README.md +35 -0
- package/node_modules/kitx/lib/index.d.ts +45 -0
- package/node_modules/kitx/lib/index.js +289 -0
- package/node_modules/kitx/package.json +41 -0
- package/node_modules/long/LICENSE +202 -0
- package/node_modules/long/README.md +246 -0
- package/node_modules/long/dist/long.js +2 -0
- package/node_modules/long/dist/long.js.map +1 -0
- package/node_modules/long/index.js +1 -0
- package/node_modules/long/package.json +34 -0
- package/node_modules/long/src/long.js +1323 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/p-timeout/index.d.ts +113 -0
- package/node_modules/p-timeout/index.js +71 -0
- package/node_modules/p-timeout/license +9 -0
- package/node_modules/p-timeout/package.json +44 -0
- package/node_modules/p-timeout/readme.md +117 -0
- package/node_modules/safer-buffer/LICENSE +21 -0
- package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/node_modules/safer-buffer/Readme.md +156 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/sdk-base/LICENSE +21 -0
- package/node_modules/sdk-base/README.md +165 -0
- package/node_modules/sdk-base/index.d.ts +29 -0
- package/node_modules/sdk-base/index.js +251 -0
- package/node_modules/sdk-base/package.json +54 -0
- package/node_modules/serialize-json/LICENSE +21 -0
- package/node_modules/serialize-json/README.md +74 -0
- package/node_modules/serialize-json/lib/decoder.js +190 -0
- package/node_modules/serialize-json/lib/encoder.js +200 -0
- package/node_modules/serialize-json/lib/index.js +15 -0
- package/node_modules/serialize-json/package.json +53 -0
- package/node_modules/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +135 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +53 -0
- package/node_modules/supports-color/readme.md +76 -0
- package/node_modules/tcp-base/LICENSE +21 -0
- package/node_modules/tcp-base/README.md +134 -0
- package/node_modules/tcp-base/lib/base.js +456 -0
- package/node_modules/tcp-base/package.json +44 -0
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +31 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client.d.ts +108 -0
- package/node_modules/undici-types/connector.d.ts +34 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +28 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/node_modules/undici-types/errors.d.ts +149 -0
- package/node_modules/undici-types/eventsource.d.ts +61 -0
- package/node_modules/undici-types/fetch.d.ts +209 -0
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/handlers.d.ts +15 -0
- package/node_modules/undici-types/header.d.ts +4 -0
- package/node_modules/undici-types/index.d.ts +71 -0
- package/node_modules/undici-types/interceptors.d.ts +17 -0
- package/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/node_modules/undici-types/mock-client.d.ts +25 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +33 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +39 -0
- package/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/node_modules/undici-types/readable.d.ts +65 -0
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/webidl.d.ts +228 -0
- package/node_modules/undici-types/websocket.d.ts +150 -0
- package/node_modules/unescape/LICENSE +21 -0
- package/node_modules/unescape/README.md +134 -0
- package/node_modules/unescape/index.js +103 -0
- package/node_modules/unescape/package.json +67 -0
- package/node_modules/utility/LICENSE.txt +21 -0
- package/node_modules/utility/README.md +370 -0
- package/node_modules/utility/dist/commonjs/array.d.ts +11 -0
- package/node_modules/utility/dist/commonjs/array.js +46 -0
- package/node_modules/utility/dist/commonjs/crypto.d.ts +86 -0
- package/node_modules/utility/dist/commonjs/crypto.js +159 -0
- package/node_modules/utility/dist/commonjs/date.d.ts +63 -0
- package/node_modules/utility/dist/commonjs/date.js +219 -0
- package/node_modules/utility/dist/commonjs/fs.d.ts +6 -0
- package/node_modules/utility/dist/commonjs/fs.js +20 -0
- package/node_modules/utility/dist/commonjs/function.d.ts +12 -0
- package/node_modules/utility/dist/commonjs/function.js +35 -0
- package/node_modules/utility/dist/commonjs/index.d.ts +12 -0
- package/node_modules/utility/dist/commonjs/index.js +29 -0
- package/node_modules/utility/dist/commonjs/json.d.ts +14 -0
- package/node_modules/utility/dist/commonjs/json.js +41 -0
- package/node_modules/utility/dist/commonjs/number.d.ts +24 -0
- package/node_modules/utility/dist/commonjs/number.js +66 -0
- package/node_modules/utility/dist/commonjs/object.d.ts +20 -0
- package/node_modules/utility/dist/commonjs/object.js +73 -0
- package/node_modules/utility/dist/commonjs/optimize.d.ts +21 -0
- package/node_modules/utility/dist/commonjs/optimize.js +60 -0
- package/node_modules/utility/dist/commonjs/package.json +3 -0
- package/node_modules/utility/dist/commonjs/string.d.ts +29 -0
- package/node_modules/utility/dist/commonjs/string.js +126 -0
- package/node_modules/utility/dist/commonjs/timeout.d.ts +6 -0
- package/node_modules/utility/dist/commonjs/timeout.js +34 -0
- package/node_modules/utility/dist/commonjs/web.d.ts +29 -0
- package/node_modules/utility/dist/commonjs/web.js +61 -0
- package/node_modules/utility/dist/esm/array.d.ts +11 -0
- package/node_modules/utility/dist/esm/array.js +42 -0
- package/node_modules/utility/dist/esm/crypto.d.ts +86 -0
- package/node_modules/utility/dist/esm/crypto.js +146 -0
- package/node_modules/utility/dist/esm/date.d.ts +63 -0
- package/node_modules/utility/dist/esm/date.js +204 -0
- package/node_modules/utility/dist/esm/fs.d.ts +6 -0
- package/node_modules/utility/dist/esm/fs.js +17 -0
- package/node_modules/utility/dist/esm/function.d.ts +12 -0
- package/node_modules/utility/dist/esm/function.js +28 -0
- package/node_modules/utility/dist/esm/index.d.ts +12 -0
- package/node_modules/utility/dist/esm/index.js +13 -0
- package/node_modules/utility/dist/esm/json.d.ts +14 -0
- package/node_modules/utility/dist/esm/json.js +34 -0
- package/node_modules/utility/dist/esm/number.d.ts +24 -0
- package/node_modules/utility/dist/esm/number.js +60 -0
- package/node_modules/utility/dist/esm/object.d.ts +20 -0
- package/node_modules/utility/dist/esm/object.js +67 -0
- package/node_modules/utility/dist/esm/optimize.d.ts +21 -0
- package/node_modules/utility/dist/esm/optimize.js +54 -0
- package/node_modules/utility/dist/esm/package.json +3 -0
- package/node_modules/utility/dist/esm/string.d.ts +29 -0
- package/node_modules/utility/dist/esm/string.js +118 -0
- package/node_modules/utility/dist/esm/timeout.d.ts +6 -0
- package/node_modules/utility/dist/esm/timeout.js +28 -0
- package/node_modules/utility/dist/esm/web.d.ts +29 -0
- package/node_modules/utility/dist/esm/web.js +52 -0
- package/node_modules/utility/dist/package.json +4 -0
- package/node_modules/utility/package.json +85 -0
- package/node_modules/utility/src/array.ts +44 -0
- package/node_modules/utility/src/crypto.ts +160 -0
- package/node_modules/utility/src/date.ts +232 -0
- package/node_modules/utility/src/fs.ts +17 -0
- package/node_modules/utility/src/function.ts +30 -0
- package/node_modules/utility/src/index.ts +12 -0
- package/node_modules/utility/src/json.ts +48 -0
- package/node_modules/utility/src/number.ts +63 -0
- package/node_modules/utility/src/object.ts +72 -0
- package/node_modules/utility/src/optimize.ts +62 -0
- package/node_modules/utility/src/string.ts +132 -0
- package/node_modules/utility/src/timeout.ts +37 -0
- package/node_modules/utility/src/web.ts +53 -0
- package/node_modules/ylru/LICENSE +25 -0
- package/node_modules/ylru/README.md +120 -0
- package/node_modules/ylru/dist/commonjs/index.d.ts +21 -0
- package/node_modules/ylru/dist/commonjs/index.js +112 -0
- package/node_modules/ylru/dist/commonjs/package.json +3 -0
- package/node_modules/ylru/dist/esm/index.d.ts +21 -0
- package/node_modules/ylru/dist/esm/index.js +108 -0
- package/node_modules/ylru/dist/esm/package.json +3 -0
- package/node_modules/ylru/package.json +71 -0
- package/node_modules/ylru/src/index.ts +124 -0
- package/package.json +2 -2
- package/node_modules/@ali/cli-skills/dist/_chunks/libs/abort-controller.mjs +0 -424
- package/node_modules/@ali/cli-skills/dist/_chunks/libs/archiver.mjs +0 -19586
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)
|
|
2
|
+
|
|
3
|
+
> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
|
4
|
+
|
|
5
|
+
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
|
6
|
+
|
|
7
|
+
<img src="screenshot.svg" width="900">
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
$ npm install ansi-styles
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const style = require('ansi-styles');
|
|
19
|
+
|
|
20
|
+
console.log(`${style.green.open}Hello world!${style.green.close}`);
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// Color conversion between 16/256/truecolor
|
|
24
|
+
// NOTE: If conversion goes to 16 colors or 256 colors, the original color
|
|
25
|
+
// may be degraded to fit that color palette. This means terminals
|
|
26
|
+
// that do not support 16 million colors will best-match the
|
|
27
|
+
// original color.
|
|
28
|
+
console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
|
|
29
|
+
console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
|
|
30
|
+
console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## API
|
|
34
|
+
|
|
35
|
+
Each style has an `open` and `close` property.
|
|
36
|
+
|
|
37
|
+
## Styles
|
|
38
|
+
|
|
39
|
+
### Modifiers
|
|
40
|
+
|
|
41
|
+
- `reset`
|
|
42
|
+
- `bold`
|
|
43
|
+
- `dim`
|
|
44
|
+
- `italic` *(Not widely supported)*
|
|
45
|
+
- `underline`
|
|
46
|
+
- `inverse`
|
|
47
|
+
- `hidden`
|
|
48
|
+
- `strikethrough` *(Not widely supported)*
|
|
49
|
+
|
|
50
|
+
### Colors
|
|
51
|
+
|
|
52
|
+
- `black`
|
|
53
|
+
- `red`
|
|
54
|
+
- `green`
|
|
55
|
+
- `yellow`
|
|
56
|
+
- `blue`
|
|
57
|
+
- `magenta`
|
|
58
|
+
- `cyan`
|
|
59
|
+
- `white`
|
|
60
|
+
- `blackBright` (alias: `gray`, `grey`)
|
|
61
|
+
- `redBright`
|
|
62
|
+
- `greenBright`
|
|
63
|
+
- `yellowBright`
|
|
64
|
+
- `blueBright`
|
|
65
|
+
- `magentaBright`
|
|
66
|
+
- `cyanBright`
|
|
67
|
+
- `whiteBright`
|
|
68
|
+
|
|
69
|
+
### Background colors
|
|
70
|
+
|
|
71
|
+
- `bgBlack`
|
|
72
|
+
- `bgRed`
|
|
73
|
+
- `bgGreen`
|
|
74
|
+
- `bgYellow`
|
|
75
|
+
- `bgBlue`
|
|
76
|
+
- `bgMagenta`
|
|
77
|
+
- `bgCyan`
|
|
78
|
+
- `bgWhite`
|
|
79
|
+
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
|
|
80
|
+
- `bgRedBright`
|
|
81
|
+
- `bgGreenBright`
|
|
82
|
+
- `bgYellowBright`
|
|
83
|
+
- `bgBlueBright`
|
|
84
|
+
- `bgMagentaBright`
|
|
85
|
+
- `bgCyanBright`
|
|
86
|
+
- `bgWhiteBright`
|
|
87
|
+
|
|
88
|
+
## Advanced usage
|
|
89
|
+
|
|
90
|
+
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
|
91
|
+
|
|
92
|
+
- `style.modifier`
|
|
93
|
+
- `style.color`
|
|
94
|
+
- `style.bgColor`
|
|
95
|
+
|
|
96
|
+
###### Example
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
console.log(style.color.green.open);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
|
|
103
|
+
|
|
104
|
+
###### Example
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
console.log(style.codes.get(36));
|
|
108
|
+
//=> 39
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
|
|
112
|
+
|
|
113
|
+
`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
|
|
114
|
+
|
|
115
|
+
The following color spaces from `color-convert` are supported:
|
|
116
|
+
|
|
117
|
+
- `rgb`
|
|
118
|
+
- `hex`
|
|
119
|
+
- `keyword`
|
|
120
|
+
- `hsl`
|
|
121
|
+
- `hsv`
|
|
122
|
+
- `hwb`
|
|
123
|
+
- `ansi`
|
|
124
|
+
- `ansi256`
|
|
125
|
+
|
|
126
|
+
To use these, call the associated conversion function with the intended output, for example:
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
|
|
130
|
+
style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
|
|
131
|
+
|
|
132
|
+
style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
|
133
|
+
style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
|
134
|
+
|
|
135
|
+
style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
|
|
136
|
+
style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Related
|
|
140
|
+
|
|
141
|
+
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
|
|
142
|
+
|
|
143
|
+
## Maintainers
|
|
144
|
+
|
|
145
|
+
- [Sindre Sorhus](https://github.com/sindresorhus)
|
|
146
|
+
- [Josh Junon](https://github.com/qix-)
|
|
147
|
+
|
|
148
|
+
## For enterprise
|
|
149
|
+
|
|
150
|
+
Available as part of the Tidelift Subscription.
|
|
151
|
+
|
|
152
|
+
The maintainers of `ansi-styles` 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-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Await Event
|
|
2
|
+
|
|
3
|
+
A really stupid utility I use frequently for event emitters.
|
|
4
|
+
Allows you to `yield` an event and return the results.
|
|
5
|
+
I use this a lot of locking.
|
|
6
|
+
|
|
7
|
+
Note: you probably shouldn't use this for the `error` event.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
var PassThrough = require('stream').PassThrough
|
|
13
|
+
|
|
14
|
+
var stream = new PassThrough()
|
|
15
|
+
// you attach it directly on an event emitter
|
|
16
|
+
stream.await = require('await-event')
|
|
17
|
+
|
|
18
|
+
co(function* () {
|
|
19
|
+
var chunk = yield stream.await('data')
|
|
20
|
+
var chunk = yield stream.await('data')
|
|
21
|
+
var chunk = yield stream.await('data')
|
|
22
|
+
}).catch(noop)
|
|
23
|
+
|
|
24
|
+
stream.write('some chunk')
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
You can use awaitEvent without attach on an event emitter:
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
var EventEmitter = require('event')
|
|
31
|
+
|
|
32
|
+
var emitter = new EventEmitter()
|
|
33
|
+
co(function*() {
|
|
34
|
+
yield awaitEvent(emitter, 'ready')
|
|
35
|
+
}).catch(noop)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
When use this for `error` event, it will reject once `error` event emitted:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
var EventEmitter = require('event')
|
|
42
|
+
|
|
43
|
+
var emitter = new EventEmitter()
|
|
44
|
+
co(function*() {
|
|
45
|
+
// it will throw when `error` event emitted
|
|
46
|
+
yield awaitEvent(emitter, 'error')
|
|
47
|
+
}).catch(err => console.error(err.stack))
|
|
48
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
module.exports = function(emitter, event) {
|
|
4
|
+
if (typeof emitter === 'string') {
|
|
5
|
+
event = emitter
|
|
6
|
+
emitter = this
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const done = event === 'error' ? reject : resolve
|
|
11
|
+
emitter.once(event, done)
|
|
12
|
+
})
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "await-event",
|
|
3
|
+
"description": "yield an event with generators",
|
|
4
|
+
"version": "2.1.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Jonathan Ong",
|
|
7
|
+
"email": "me@jongleberry.com",
|
|
8
|
+
"url": "http://jongleberry.com",
|
|
9
|
+
"twitter": "https://twitter.com/jongleberry"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": "cojs/await-event",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"co",
|
|
15
|
+
"events",
|
|
16
|
+
"event-emitter",
|
|
17
|
+
"await"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "jest --forceExit",
|
|
21
|
+
"test-cov": "jest --coverage --forceExit"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"co": "^4.6.0",
|
|
25
|
+
"jest": "^18.1.0"
|
|
26
|
+
},
|
|
27
|
+
"jest": {
|
|
28
|
+
"testEnvironment": "node"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"index.js"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 zōng yǔ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# await-first
|
|
2
|
+
Wait the first event in a set of event pairs, then clean up after itself.
|
|
3
|
+
|
|
4
|
+
[![NPM version][npm-image]][npm-url]
|
|
5
|
+
[![build status][travis-image]][travis-url]
|
|
6
|
+
[![Test coverage][codecov-image]][codecov-url]
|
|
7
|
+
[![David deps][david-image]][david-url]
|
|
8
|
+
[![Known Vulnerabilities][snyk-image]][snyk-url]
|
|
9
|
+
[![npm download][download-image]][download-url]
|
|
10
|
+
|
|
11
|
+
[npm-image]: https://img.shields.io/npm/v/await-first.svg?style=flat-square
|
|
12
|
+
[npm-url]: https://npmjs.org/package/await-first
|
|
13
|
+
[travis-image]: https://img.shields.io/travis/node-modules/await-first.svg?style=flat-square
|
|
14
|
+
[travis-url]: https://travis-ci.org/node-modules/await-first
|
|
15
|
+
[codecov-image]: https://codecov.io/gh/node-modules/await-first/branch/master/graph/badge.svg
|
|
16
|
+
[codecov-url]: https://codecov.io/gh/node-modules/await-first
|
|
17
|
+
[david-image]: https://img.shields.io/david/node-modules/await-first.svg?style=flat-square
|
|
18
|
+
[david-url]: https://david-dm.org/node-modules/await-first
|
|
19
|
+
[snyk-image]: https://snyk.io/test/npm/await-first/badge.svg?style=flat-square
|
|
20
|
+
[snyk-url]: https://snyk.io/test/npm/await-first
|
|
21
|
+
[download-image]: https://img.shields.io/npm/dm/await-first.svg?style=flat-square
|
|
22
|
+
[download-url]: https://npmjs.org/package/await-first
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
$ npm install await-first --save
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
- `awaitFirst(ee, events)`
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
const EventEmitter = require('events');
|
|
36
|
+
const awaitFirst = require('await-first');
|
|
37
|
+
|
|
38
|
+
async function waitMessageOrClose(ee) {
|
|
39
|
+
const o = await awaitFirst(ee, [ 'message', 'close' ]);
|
|
40
|
+
|
|
41
|
+
switch (o.event) {
|
|
42
|
+
case 'message':
|
|
43
|
+
const msg = o.args[0]; // [ 'hello world' ]
|
|
44
|
+
console.log('new message =>', msg);
|
|
45
|
+
break;
|
|
46
|
+
case 'close':
|
|
47
|
+
console.log('closed');
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const ee = new EventEmitter();
|
|
53
|
+
waitMessageOrClose(ee);
|
|
54
|
+
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
ee.emit('message', 'hello world');
|
|
57
|
+
}, 1000);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- `obj.awaitFirst(events)`
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
const net = require('net');
|
|
64
|
+
const awaitFirst = require('await-first');
|
|
65
|
+
|
|
66
|
+
async function connect() {
|
|
67
|
+
const socket = net.connect(8080, '127.0.0.1');
|
|
68
|
+
socket.awaitFirst = awaitFirst;
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
// wait `connect` or `error` event
|
|
72
|
+
await socket.awaitFirst([ 'connect', 'error' ]);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
console.log(err);
|
|
75
|
+
}
|
|
76
|
+
// ...
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
connect();
|
|
80
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const first = require('ee-first');
|
|
4
|
+
|
|
5
|
+
module.exports = function(emitter, events) {
|
|
6
|
+
if (Array.isArray(emitter)) {
|
|
7
|
+
events = emitter;
|
|
8
|
+
emitter = this;
|
|
9
|
+
}
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
first([
|
|
12
|
+
[ emitter ].concat(events),
|
|
13
|
+
], (err, ee, event, args) => {
|
|
14
|
+
if (err) {
|
|
15
|
+
reject(err);
|
|
16
|
+
} else {
|
|
17
|
+
resolve({ event, args });
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "await-first",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Wait the first event in a set of event emitters and event pairs, then clean up after itself.",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"lib"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"autod": "autod",
|
|
11
|
+
"pkgfiles": "egg-bin pkgfiles --check",
|
|
12
|
+
"test": "npm run lint && npm run test-local",
|
|
13
|
+
"test-local": "egg-bin test",
|
|
14
|
+
"cov": "TEST_TIMEOUT=5000 egg-bin cov",
|
|
15
|
+
"lint": "eslint . --ext .js",
|
|
16
|
+
"ci": "npm run autod -- --check && npm run pkgfiles && npm run lint && npm run cov"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/node-modules/await-first.git"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"ee-first",
|
|
24
|
+
"await"
|
|
25
|
+
],
|
|
26
|
+
"author": "gxcsoccer <gxcsoccer@126.com>",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/node-modules/await-first/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/node-modules/await-first#readme",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"ee-first": "^1.1.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"autod": "^3.0.1",
|
|
37
|
+
"egg-bin": "^4.3.5",
|
|
38
|
+
"egg-ci": "^1.8.0",
|
|
39
|
+
"eslint": "^4.11.0",
|
|
40
|
+
"eslint-config-egg": "^5.1.1",
|
|
41
|
+
"mm": "^2.2.0"
|
|
42
|
+
},
|
|
43
|
+
"ci": {
|
|
44
|
+
"version": "6, 8, 9"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">= 6.0.0"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
This software is licensed under the MIT License.
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2013 - 2014 fengmk2 <fengmk2@gmail.com> and other contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
byte
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
[![NPM version][npm-image]][npm-url]
|
|
5
|
+
[![build status][travis-image]][travis-url]
|
|
6
|
+
[![Test coverage][coveralls-image]][coveralls-url]
|
|
7
|
+
[![Gittip][gittip-image]][gittip-url]
|
|
8
|
+
[![David deps][david-image]][david-url]
|
|
9
|
+
[![node version][node-image]][node-url]
|
|
10
|
+
[![npm download][download-image]][download-url]
|
|
11
|
+
|
|
12
|
+
[npm-image]: https://img.shields.io/npm/v/byte.svg?style=flat-square
|
|
13
|
+
[npm-url]: https://npmjs.org/package/byte
|
|
14
|
+
[travis-image]: https://img.shields.io/travis/node-modules/byte.svg?style=flat-square
|
|
15
|
+
[travis-url]: https://travis-ci.org/node-modules/byte
|
|
16
|
+
[coveralls-image]: https://img.shields.io/coveralls/node-modules/byte.svg?style=flat-square
|
|
17
|
+
[coveralls-url]: https://coveralls.io/r/node-modules/byte?branch=master
|
|
18
|
+
[gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat-square
|
|
19
|
+
[gittip-url]: https://www.gittip.com/fengmk2/
|
|
20
|
+
[david-image]: https://img.shields.io/david/node-modules/byte.svg?style=flat-square
|
|
21
|
+
[david-url]: https://david-dm.org/node-modules/byte
|
|
22
|
+
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
|
|
23
|
+
[node-url]: http://nodejs.org/download/
|
|
24
|
+
[download-image]: https://img.shields.io/npm/dm/byte.svg?style=flat-square
|
|
25
|
+
[download-url]: https://npmjs.org/package/byte
|
|
26
|
+
|
|
27
|
+
Input Buffer and Output Buffer,
|
|
28
|
+
just like Java [`ByteBuffer`](http://docs.oracle.com/javase/6/docs/api/java/nio/ByteBuffer.html).
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
$ npm install byte --save
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
All methods just like Java ByteBuffer,
|
|
39
|
+
you find them out [here](http://docs.oracle.com/javase/6/docs/api/java/nio/ByteBuffer.html#method_summary).
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
var ByteBuffer = require('byte');
|
|
43
|
+
|
|
44
|
+
var bb = ByteBuffer.allocate(1024);
|
|
45
|
+
bb.order(ByteBuffer.BIG_ENDIAN); // default is BIG_ENDIAN, you can change it to LITTLE_ENDIAN.
|
|
46
|
+
bb.put(0);
|
|
47
|
+
bb.put(new Buffer([0, 1, 2]));
|
|
48
|
+
bb.put(new Buffer([255, 255, 255, 255]), 10, 3);
|
|
49
|
+
bb.put(21, 100);
|
|
50
|
+
|
|
51
|
+
bb.putChar('a');
|
|
52
|
+
bb.putChar(10, 'b');
|
|
53
|
+
|
|
54
|
+
bb.putInt(1024);
|
|
55
|
+
bb.putInt(-100);
|
|
56
|
+
|
|
57
|
+
bb.putFloat(100.9);
|
|
58
|
+
|
|
59
|
+
bb.putLong(10000100009099);
|
|
60
|
+
bb.putLong('1152921504606847000');
|
|
61
|
+
|
|
62
|
+
bb.putShort(65535);
|
|
63
|
+
bb.putShort(-50000);
|
|
64
|
+
|
|
65
|
+
bb.putDouble(99.99999);
|
|
66
|
+
|
|
67
|
+
// wrap for read
|
|
68
|
+
var rb = ByteBuffer.wrap(new Buffer(100));
|
|
69
|
+
rb.getInt();
|
|
70
|
+
rb.getLong();
|
|
71
|
+
rb.getChar();
|
|
72
|
+
rb.get();
|
|
73
|
+
rb.getDouble();
|
|
74
|
+
rb.getFloat();
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Benchmark
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
$ node benchmark/put.js
|
|
81
|
+
|
|
82
|
+
node version: v0.11.12, date: Mon May 12 2014 18:25:35 GMT+0800 (CST)
|
|
83
|
+
Starting...
|
|
84
|
+
20 tests completed.
|
|
85
|
+
|
|
86
|
+
put() x 29,971,599 ops/sec ±4.10% (96 runs sampled)
|
|
87
|
+
putChar("a") x 27,950,189 ops/sec ±6.22% (80 runs sampled)
|
|
88
|
+
putChar(61) x 34,798,492 ops/sec ±5.08% (81 runs sampled)
|
|
89
|
+
putShort() x 25,264,781 ops/sec ±2.90% (88 runs sampled)
|
|
90
|
+
putInt() x 21,368,588 ops/sec ±6.07% (85 runs sampled)
|
|
91
|
+
putFloat() x 12,324,148 ops/sec ±2.04% (93 runs sampled)
|
|
92
|
+
putDouble() x 13,374,686 ops/sec ±1.41% (92 runs sampled)
|
|
93
|
+
putLong(100000) x 17,754,878 ops/sec ±5.16% (86 runs sampled)
|
|
94
|
+
putSmallSLong("10000") x 7,732,989 ops/sec ±2.07% (92 runs sampled)
|
|
95
|
+
putBigNumLong(34359738368) x 3,580,231 ops/sec ±2.58% (93 runs sampled)
|
|
96
|
+
putSafeStrLong("34359738368") x 2,443,560 ops/sec ±2.04% (97 runs sampled)
|
|
97
|
+
putStrLong("9223372036854775808") x 760,908 ops/sec ±2.42% (92 runs sampled)
|
|
98
|
+
ByteBuffer.allocate(100).putString(0, str) x 608,403 ops/sec ±11.46% (70 runs sampled)
|
|
99
|
+
putString(0, str) x 1,362,412 ops/sec ±8.55% (85 runs sampled)
|
|
100
|
+
bytes.putString(str) x 1,506,610 ops/sec ±2.31% (94 runs sampled)
|
|
101
|
+
putString(0, buf) x 5,947,594 ops/sec ±4.16% (90 runs sampled)
|
|
102
|
+
bytes.putString(buf) x 5,741,251 ops/sec ±1.69% (95 runs sampled)
|
|
103
|
+
putRawString(0, str) x 2,908,161 ops/sec ±1.81% (95 runs sampled)
|
|
104
|
+
bytes.putRawString(str) x 1,527,089 ops/sec ±4.98% (86 runs sampled)
|
|
105
|
+
bytes.putRawString(str).array() x 1,009,026 ops/sec ±2.38% (91 runs sampled)
|
|
106
|
+
|
|
107
|
+
$node benchmark/get.js
|
|
108
|
+
|
|
109
|
+
node version: v0.11.12, date: Mon May 12 2014 19:14:26 GMT+0800 (CST)
|
|
110
|
+
Starting...
|
|
111
|
+
15 tests completed.
|
|
112
|
+
|
|
113
|
+
get(0, 1) => copy Buffer x 2,059,464 ops/sec ±9.18% (69 runs sampled)
|
|
114
|
+
get(0, 100) => copy Buffer x 2,124,455 ops/sec ±4.98% (75 runs sampled)
|
|
115
|
+
get(0, 4096) => copy Buffer x 356,927 ops/sec ±9.43% (56 runs sampled)
|
|
116
|
+
get() => byte x 15,477,897 ops/sec ±3.05% (89 runs sampled)
|
|
117
|
+
getChar(0) x 52,541,591 ops/sec ±1.04% (95 runs sampled)
|
|
118
|
+
getShort(0) x 26,297,086 ops/sec ±2.46% (89 runs sampled)
|
|
119
|
+
getInt(0) x 18,772,003 ops/sec ±6.27% (71 runs sampled)
|
|
120
|
+
getFloat(0) x 13,132,298 ops/sec ±1.68% (97 runs sampled)
|
|
121
|
+
getDouble(0) x 10,968,594 ops/sec ±1.27% (94 runs sampled)
|
|
122
|
+
getLong(0) x 11,849,374 ops/sec ±2.63% (96 runs sampled)
|
|
123
|
+
getString(0) x 2,358,382 ops/sec ±5.78% (76 runs sampled)
|
|
124
|
+
getCString(0) x 1,618,356 ops/sec ±8.41% (72 runs sampled)
|
|
125
|
+
readRawString(4, 100) x 4,790,991 ops/sec ±9.25% (79 runs sampled)
|
|
126
|
+
readRawString(100) x 5,434,663 ops/sec ±1.32% (95 runs sampled)
|
|
127
|
+
getRawString(0, 100) x 5,497,325 ops/sec ±1.02% (98 runs sampled)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## `Number` methods
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
putShort / putInt16
|
|
134
|
+
putUInt16
|
|
135
|
+
putInt / putInt32
|
|
136
|
+
putUInt / putUInt32
|
|
137
|
+
putInt64
|
|
138
|
+
putFloat
|
|
139
|
+
putDouble
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
getShort / getInt16
|
|
143
|
+
getUInt16
|
|
144
|
+
getInt / getInt32
|
|
145
|
+
getUInt / getUInt32
|
|
146
|
+
getInt64
|
|
147
|
+
getFloat
|
|
148
|
+
getDouble
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## `String` methods
|
|
152
|
+
|
|
153
|
+
Java String format: `| length (4 bytes int) | string bytes |`
|
|
154
|
+
|
|
155
|
+
C String format: `| length + 1 (4 bytes int) | string bytes | \0 |`
|
|
156
|
+
|
|
157
|
+
Row String format: `string bytes`
|
|
158
|
+
|
|
159
|
+
### `putString()` and `putCString()` and `putRawString()`
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
bb.putString('foo');
|
|
163
|
+
bb.putString(new Buffer('foo'));
|
|
164
|
+
|
|
165
|
+
bb.putCString('foo');
|
|
166
|
+
bb.putCString(new Buffer('foo'));
|
|
167
|
+
|
|
168
|
+
bb.putRawString('foo');
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `getString()` and `getCString()` and `getRawString(), readRawString()`
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
bb.getString();
|
|
175
|
+
bb.getString(10);
|
|
176
|
+
|
|
177
|
+
bb.getCString();
|
|
178
|
+
bb.getCString(10);
|
|
179
|
+
|
|
180
|
+
bb.getRawString(0, 10);
|
|
181
|
+
bb.readRawString(10);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## License
|
|
185
|
+
|
|
186
|
+
(The MIT License)
|
|
187
|
+
|
|
188
|
+
Copyright (c) 2013 - 2014 fengmk2 <fengmk2@gmail.com> and other contributors
|
|
189
|
+
|
|
190
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
191
|
+
a copy of this software and associated documentation files (the
|
|
192
|
+
'Software'), to deal in the Software without restriction, including
|
|
193
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
194
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
195
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
196
|
+
the following conditions:
|
|
197
|
+
|
|
198
|
+
The above copyright notice and this permission notice shall be
|
|
199
|
+
included in all copies or substantial portions of the Software.
|
|
200
|
+
|
|
201
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
202
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
203
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
204
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
205
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
206
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
207
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|