step-node-agent 3.29.1 → 3.29.3-customJava25

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.
Files changed (111) hide show
  1. package/node_modules/har-validator/node_modules/ajv/README.md +14 -6
  2. package/node_modules/har-validator/node_modules/ajv/dist/ajv.bundle.js +23 -11
  3. package/node_modules/har-validator/node_modules/ajv/dist/ajv.min.js +2 -2
  4. package/node_modules/har-validator/node_modules/ajv/dist/ajv.min.js.map +1 -1
  5. package/node_modules/har-validator/node_modules/ajv/lib/ajv.d.ts +5 -0
  6. package/node_modules/har-validator/node_modules/ajv/lib/compile/index.js +8 -6
  7. package/node_modules/har-validator/node_modules/ajv/lib/dot/pattern.jst +15 -4
  8. package/node_modules/har-validator/node_modules/ajv/lib/dotjs/pattern.js +14 -4
  9. package/node_modules/har-validator/node_modules/ajv/package.json +2 -1
  10. package/node_modules/har-validator/node_modules/ajv/scripts/info +0 -0
  11. package/node_modules/har-validator/node_modules/ajv/scripts/prepare-tests +0 -0
  12. package/node_modules/har-validator/node_modules/ajv/scripts/publish-built-version +0 -0
  13. package/node_modules/har-validator/node_modules/ajv/scripts/travis-gh-pages +0 -0
  14. package/node_modules/minimatch/README.md +37 -0
  15. package/node_modules/minimatch/minimatch.js +160 -102
  16. package/node_modules/minimatch/package.json +2 -2
  17. package/node_modules/qs/.editorconfig +1 -1
  18. package/node_modules/qs/.github/SECURITY.md +11 -0
  19. package/node_modules/qs/.github/THREAT_MODEL.md +78 -0
  20. package/node_modules/qs/CHANGELOG.md +22 -0
  21. package/node_modules/qs/README.md +11 -4
  22. package/node_modules/qs/dist/qs.js +24 -24
  23. package/node_modules/qs/eslint.config.mjs +56 -0
  24. package/node_modules/qs/lib/parse.js +90 -47
  25. package/node_modules/qs/lib/utils.js +83 -11
  26. package/node_modules/qs/package.json +9 -8
  27. package/node_modules/qs/test/parse.js +245 -9
  28. package/node_modules/qs/test/stringify.js +7 -3
  29. package/node_modules/qs/test/utils.js +135 -0
  30. package/node_modules/request/node_modules/qs/CHANGELOG.md +12 -0
  31. package/node_modules/request/node_modules/qs/README.md +9 -3
  32. package/node_modules/request/node_modules/qs/dist/qs.js +10 -10
  33. package/node_modules/request/node_modules/qs/lib/parse.js +4 -4
  34. package/node_modules/request/node_modules/qs/lib/utils.js +6 -6
  35. package/node_modules/request/node_modules/qs/package.json +13 -4
  36. package/node_modules/request/node_modules/qs/test/parse.js +9 -0
  37. package/node_modules/request/node_modules/qs/test/stringify.js +6 -0
  38. package/node_modules/send/HISTORY.md +7 -0
  39. package/node_modules/send/package.json +5 -5
  40. package/node_modules/serve-static/HISTORY.md +6 -0
  41. package/node_modules/serve-static/package.json +2 -2
  42. package/node_modules/underscore/amd/_setup.js +1 -1
  43. package/node_modules/underscore/amd/pipe.js +13 -0
  44. package/node_modules/underscore/cjs/_setup.js +1 -1
  45. package/node_modules/underscore/cjs/pipe.js +12 -0
  46. package/node_modules/underscore/modules/_flatten.js +20 -18
  47. package/node_modules/underscore/modules/_setup.js +1 -1
  48. package/node_modules/underscore/modules/index.js +2 -2
  49. package/node_modules/underscore/modules/isEqual.js +108 -93
  50. package/node_modules/underscore/modules/package.json +1 -1
  51. package/node_modules/underscore/package.json +1 -1
  52. package/node_modules/underscore/underscore-esm-min.js +3 -3
  53. package/node_modules/underscore/underscore-esm-min.js.map +1 -1
  54. package/node_modules/underscore/underscore-esm.js +132 -115
  55. package/node_modules/underscore/underscore-esm.js.map +1 -1
  56. package/node_modules/underscore/underscore-min.js +3 -3
  57. package/node_modules/underscore/underscore-min.js.map +1 -1
  58. package/node_modules/underscore/underscore-node-f.cjs +132 -115
  59. package/node_modules/underscore/underscore-node-f.cjs.map +1 -1
  60. package/node_modules/underscore/underscore-node.cjs +2 -2
  61. package/node_modules/underscore/underscore-node.mjs +2 -2
  62. package/node_modules/underscore/underscore-umd-min.js +3 -3
  63. package/node_modules/underscore/underscore-umd-min.js.map +1 -1
  64. package/node_modules/underscore/underscore-umd.js +132 -115
  65. package/node_modules/underscore/underscore-umd.js.map +1 -1
  66. package/node_modules/underscore/underscore.js +132 -115
  67. package/package.json +1 -1
  68. package/node_modules/qs/.eslintrc +0 -39
  69. package/node_modules/request/node_modules/qs/bower.json +0 -21
  70. package/node_modules/request/node_modules/qs/component.json +0 -15
  71. package/node_modules/send/node_modules/http-errors/HISTORY.md +0 -180
  72. package/node_modules/send/node_modules/http-errors/LICENSE +0 -23
  73. package/node_modules/send/node_modules/http-errors/README.md +0 -169
  74. package/node_modules/send/node_modules/http-errors/index.js +0 -289
  75. package/node_modules/send/node_modules/http-errors/package.json +0 -50
  76. package/node_modules/send/node_modules/statuses/HISTORY.md +0 -82
  77. package/node_modules/send/node_modules/statuses/LICENSE +0 -23
  78. package/node_modules/send/node_modules/statuses/README.md +0 -136
  79. package/node_modules/send/node_modules/statuses/codes.json +0 -65
  80. package/node_modules/send/node_modules/statuses/index.js +0 -146
  81. package/node_modules/send/node_modules/statuses/package.json +0 -49
  82. package/node_modules/serve-static/node_modules/http-errors/HISTORY.md +0 -180
  83. package/node_modules/serve-static/node_modules/http-errors/LICENSE +0 -23
  84. package/node_modules/serve-static/node_modules/http-errors/README.md +0 -169
  85. package/node_modules/serve-static/node_modules/http-errors/index.js +0 -289
  86. package/node_modules/serve-static/node_modules/http-errors/package.json +0 -50
  87. package/node_modules/serve-static/node_modules/ms/index.js +0 -162
  88. package/node_modules/serve-static/node_modules/ms/license.md +0 -21
  89. package/node_modules/serve-static/node_modules/ms/package.json +0 -38
  90. package/node_modules/serve-static/node_modules/ms/readme.md +0 -59
  91. package/node_modules/serve-static/node_modules/send/HISTORY.md +0 -526
  92. package/node_modules/serve-static/node_modules/send/LICENSE +0 -23
  93. package/node_modules/serve-static/node_modules/send/README.md +0 -327
  94. package/node_modules/serve-static/node_modules/send/SECURITY.md +0 -24
  95. package/node_modules/serve-static/node_modules/send/index.js +0 -1142
  96. package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/HISTORY.md +0 -14
  97. package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/LICENSE +0 -22
  98. package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/README.md +0 -128
  99. package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/index.js +0 -60
  100. package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/package.json +0 -40
  101. package/node_modules/serve-static/node_modules/send/package.json +0 -62
  102. package/node_modules/serve-static/node_modules/statuses/HISTORY.md +0 -82
  103. package/node_modules/serve-static/node_modules/statuses/LICENSE +0 -23
  104. package/node_modules/serve-static/node_modules/statuses/README.md +0 -136
  105. package/node_modules/serve-static/node_modules/statuses/codes.json +0 -65
  106. package/node_modules/serve-static/node_modules/statuses/index.js +0 -146
  107. package/node_modules/serve-static/node_modules/statuses/package.json +0 -49
  108. package/node_modules/underscore/amd/_set.js +0 -21
  109. package/node_modules/underscore/amd/set.js +0 -15
  110. package/node_modules/underscore/cjs/_set.js +0 -21
  111. package/node_modules/underscore/cjs/set.js +0 -15
@@ -1,289 +0,0 @@
1
- /*!
2
- * http-errors
3
- * Copyright(c) 2014 Jonathan Ong
4
- * Copyright(c) 2016 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */
7
-
8
- 'use strict'
9
-
10
- /**
11
- * Module dependencies.
12
- * @private
13
- */
14
-
15
- var deprecate = require('depd')('http-errors')
16
- var setPrototypeOf = require('setprototypeof')
17
- var statuses = require('statuses')
18
- var inherits = require('inherits')
19
- var toIdentifier = require('toidentifier')
20
-
21
- /**
22
- * Module exports.
23
- * @public
24
- */
25
-
26
- module.exports = createError
27
- module.exports.HttpError = createHttpErrorConstructor()
28
- module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError)
29
-
30
- // Populate exports for all constructors
31
- populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)
32
-
33
- /**
34
- * Get the code class of a status code.
35
- * @private
36
- */
37
-
38
- function codeClass (status) {
39
- return Number(String(status).charAt(0) + '00')
40
- }
41
-
42
- /**
43
- * Create a new HTTP Error.
44
- *
45
- * @returns {Error}
46
- * @public
47
- */
48
-
49
- function createError () {
50
- // so much arity going on ~_~
51
- var err
52
- var msg
53
- var status = 500
54
- var props = {}
55
- for (var i = 0; i < arguments.length; i++) {
56
- var arg = arguments[i]
57
- var type = typeof arg
58
- if (type === 'object' && arg instanceof Error) {
59
- err = arg
60
- status = err.status || err.statusCode || status
61
- } else if (type === 'number' && i === 0) {
62
- status = arg
63
- } else if (type === 'string') {
64
- msg = arg
65
- } else if (type === 'object') {
66
- props = arg
67
- } else {
68
- throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type)
69
- }
70
- }
71
-
72
- if (typeof status === 'number' && (status < 400 || status >= 600)) {
73
- deprecate('non-error status code; use only 4xx or 5xx status codes')
74
- }
75
-
76
- if (typeof status !== 'number' ||
77
- (!statuses.message[status] && (status < 400 || status >= 600))) {
78
- status = 500
79
- }
80
-
81
- // constructor
82
- var HttpError = createError[status] || createError[codeClass(status)]
83
-
84
- if (!err) {
85
- // create error
86
- err = HttpError
87
- ? new HttpError(msg)
88
- : new Error(msg || statuses.message[status])
89
- Error.captureStackTrace(err, createError)
90
- }
91
-
92
- if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
93
- // add properties to generic error
94
- err.expose = status < 500
95
- err.status = err.statusCode = status
96
- }
97
-
98
- for (var key in props) {
99
- if (key !== 'status' && key !== 'statusCode') {
100
- err[key] = props[key]
101
- }
102
- }
103
-
104
- return err
105
- }
106
-
107
- /**
108
- * Create HTTP error abstract base class.
109
- * @private
110
- */
111
-
112
- function createHttpErrorConstructor () {
113
- function HttpError () {
114
- throw new TypeError('cannot construct abstract class')
115
- }
116
-
117
- inherits(HttpError, Error)
118
-
119
- return HttpError
120
- }
121
-
122
- /**
123
- * Create a constructor for a client error.
124
- * @private
125
- */
126
-
127
- function createClientErrorConstructor (HttpError, name, code) {
128
- var className = toClassName(name)
129
-
130
- function ClientError (message) {
131
- // create the error object
132
- var msg = message != null ? message : statuses.message[code]
133
- var err = new Error(msg)
134
-
135
- // capture a stack trace to the construction point
136
- Error.captureStackTrace(err, ClientError)
137
-
138
- // adjust the [[Prototype]]
139
- setPrototypeOf(err, ClientError.prototype)
140
-
141
- // redefine the error message
142
- Object.defineProperty(err, 'message', {
143
- enumerable: true,
144
- configurable: true,
145
- value: msg,
146
- writable: true
147
- })
148
-
149
- // redefine the error name
150
- Object.defineProperty(err, 'name', {
151
- enumerable: false,
152
- configurable: true,
153
- value: className,
154
- writable: true
155
- })
156
-
157
- return err
158
- }
159
-
160
- inherits(ClientError, HttpError)
161
- nameFunc(ClientError, className)
162
-
163
- ClientError.prototype.status = code
164
- ClientError.prototype.statusCode = code
165
- ClientError.prototype.expose = true
166
-
167
- return ClientError
168
- }
169
-
170
- /**
171
- * Create function to test is a value is a HttpError.
172
- * @private
173
- */
174
-
175
- function createIsHttpErrorFunction (HttpError) {
176
- return function isHttpError (val) {
177
- if (!val || typeof val !== 'object') {
178
- return false
179
- }
180
-
181
- if (val instanceof HttpError) {
182
- return true
183
- }
184
-
185
- return val instanceof Error &&
186
- typeof val.expose === 'boolean' &&
187
- typeof val.statusCode === 'number' && val.status === val.statusCode
188
- }
189
- }
190
-
191
- /**
192
- * Create a constructor for a server error.
193
- * @private
194
- */
195
-
196
- function createServerErrorConstructor (HttpError, name, code) {
197
- var className = toClassName(name)
198
-
199
- function ServerError (message) {
200
- // create the error object
201
- var msg = message != null ? message : statuses.message[code]
202
- var err = new Error(msg)
203
-
204
- // capture a stack trace to the construction point
205
- Error.captureStackTrace(err, ServerError)
206
-
207
- // adjust the [[Prototype]]
208
- setPrototypeOf(err, ServerError.prototype)
209
-
210
- // redefine the error message
211
- Object.defineProperty(err, 'message', {
212
- enumerable: true,
213
- configurable: true,
214
- value: msg,
215
- writable: true
216
- })
217
-
218
- // redefine the error name
219
- Object.defineProperty(err, 'name', {
220
- enumerable: false,
221
- configurable: true,
222
- value: className,
223
- writable: true
224
- })
225
-
226
- return err
227
- }
228
-
229
- inherits(ServerError, HttpError)
230
- nameFunc(ServerError, className)
231
-
232
- ServerError.prototype.status = code
233
- ServerError.prototype.statusCode = code
234
- ServerError.prototype.expose = false
235
-
236
- return ServerError
237
- }
238
-
239
- /**
240
- * Set the name of a function, if possible.
241
- * @private
242
- */
243
-
244
- function nameFunc (func, name) {
245
- var desc = Object.getOwnPropertyDescriptor(func, 'name')
246
-
247
- if (desc && desc.configurable) {
248
- desc.value = name
249
- Object.defineProperty(func, 'name', desc)
250
- }
251
- }
252
-
253
- /**
254
- * Populate the exports object with constructors for every error class.
255
- * @private
256
- */
257
-
258
- function populateConstructorExports (exports, codes, HttpError) {
259
- codes.forEach(function forEachCode (code) {
260
- var CodeError
261
- var name = toIdentifier(statuses.message[code])
262
-
263
- switch (codeClass(code)) {
264
- case 400:
265
- CodeError = createClientErrorConstructor(HttpError, name, code)
266
- break
267
- case 500:
268
- CodeError = createServerErrorConstructor(HttpError, name, code)
269
- break
270
- }
271
-
272
- if (CodeError) {
273
- // export the constructor
274
- exports[code] = CodeError
275
- exports[name] = CodeError
276
- }
277
- })
278
- }
279
-
280
- /**
281
- * Get a class name from a name identifier.
282
- * @private
283
- */
284
-
285
- function toClassName (name) {
286
- return name.substr(-5) !== 'Error'
287
- ? name + 'Error'
288
- : name
289
- }
@@ -1,50 +0,0 @@
1
- {
2
- "name": "http-errors",
3
- "description": "Create HTTP error objects",
4
- "version": "2.0.0",
5
- "author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
6
- "contributors": [
7
- "Alan Plum <me@pluma.io>",
8
- "Douglas Christopher Wilson <doug@somethingdoug.com>"
9
- ],
10
- "license": "MIT",
11
- "repository": "jshttp/http-errors",
12
- "dependencies": {
13
- "depd": "2.0.0",
14
- "inherits": "2.0.4",
15
- "setprototypeof": "1.2.0",
16
- "statuses": "2.0.1",
17
- "toidentifier": "1.0.1"
18
- },
19
- "devDependencies": {
20
- "eslint": "7.32.0",
21
- "eslint-config-standard": "14.1.1",
22
- "eslint-plugin-import": "2.25.3",
23
- "eslint-plugin-markdown": "2.2.1",
24
- "eslint-plugin-node": "11.1.0",
25
- "eslint-plugin-promise": "5.2.0",
26
- "eslint-plugin-standard": "4.1.0",
27
- "mocha": "9.1.3",
28
- "nyc": "15.1.0"
29
- },
30
- "engines": {
31
- "node": ">= 0.8"
32
- },
33
- "scripts": {
34
- "lint": "eslint . && node ./scripts/lint-readme-list.js",
35
- "test": "mocha --reporter spec --bail",
36
- "test-ci": "nyc --reporter=lcov --reporter=text npm test",
37
- "test-cov": "nyc --reporter=html --reporter=text npm test",
38
- "version": "node scripts/version-history.js && git add HISTORY.md"
39
- },
40
- "keywords": [
41
- "http",
42
- "error"
43
- ],
44
- "files": [
45
- "index.js",
46
- "HISTORY.md",
47
- "LICENSE",
48
- "README.md"
49
- ]
50
- }
@@ -1,162 +0,0 @@
1
- /**
2
- * Helpers.
3
- */
4
-
5
- var s = 1000;
6
- var m = s * 60;
7
- var h = m * 60;
8
- var d = h * 24;
9
- var w = d * 7;
10
- var y = d * 365.25;
11
-
12
- /**
13
- * Parse or format the given `val`.
14
- *
15
- * Options:
16
- *
17
- * - `long` verbose formatting [false]
18
- *
19
- * @param {String|Number} val
20
- * @param {Object} [options]
21
- * @throws {Error} throw an error if val is not a non-empty string or a number
22
- * @return {String|Number}
23
- * @api public
24
- */
25
-
26
- module.exports = function (val, options) {
27
- options = options || {};
28
- var type = typeof val;
29
- if (type === 'string' && val.length > 0) {
30
- return parse(val);
31
- } else if (type === 'number' && isFinite(val)) {
32
- return options.long ? fmtLong(val) : fmtShort(val);
33
- }
34
- throw new Error(
35
- 'val is not a non-empty string or a valid number. val=' +
36
- JSON.stringify(val)
37
- );
38
- };
39
-
40
- /**
41
- * Parse the given `str` and return milliseconds.
42
- *
43
- * @param {String} str
44
- * @return {Number}
45
- * @api private
46
- */
47
-
48
- function parse(str) {
49
- str = String(str);
50
- if (str.length > 100) {
51
- return;
52
- }
53
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
54
- str
55
- );
56
- if (!match) {
57
- return;
58
- }
59
- var n = parseFloat(match[1]);
60
- var type = (match[2] || 'ms').toLowerCase();
61
- switch (type) {
62
- case 'years':
63
- case 'year':
64
- case 'yrs':
65
- case 'yr':
66
- case 'y':
67
- return n * y;
68
- case 'weeks':
69
- case 'week':
70
- case 'w':
71
- return n * w;
72
- case 'days':
73
- case 'day':
74
- case 'd':
75
- return n * d;
76
- case 'hours':
77
- case 'hour':
78
- case 'hrs':
79
- case 'hr':
80
- case 'h':
81
- return n * h;
82
- case 'minutes':
83
- case 'minute':
84
- case 'mins':
85
- case 'min':
86
- case 'm':
87
- return n * m;
88
- case 'seconds':
89
- case 'second':
90
- case 'secs':
91
- case 'sec':
92
- case 's':
93
- return n * s;
94
- case 'milliseconds':
95
- case 'millisecond':
96
- case 'msecs':
97
- case 'msec':
98
- case 'ms':
99
- return n;
100
- default:
101
- return undefined;
102
- }
103
- }
104
-
105
- /**
106
- * Short format for `ms`.
107
- *
108
- * @param {Number} ms
109
- * @return {String}
110
- * @api private
111
- */
112
-
113
- function fmtShort(ms) {
114
- var msAbs = Math.abs(ms);
115
- if (msAbs >= d) {
116
- return Math.round(ms / d) + 'd';
117
- }
118
- if (msAbs >= h) {
119
- return Math.round(ms / h) + 'h';
120
- }
121
- if (msAbs >= m) {
122
- return Math.round(ms / m) + 'm';
123
- }
124
- if (msAbs >= s) {
125
- return Math.round(ms / s) + 's';
126
- }
127
- return ms + 'ms';
128
- }
129
-
130
- /**
131
- * Long format for `ms`.
132
- *
133
- * @param {Number} ms
134
- * @return {String}
135
- * @api private
136
- */
137
-
138
- function fmtLong(ms) {
139
- var msAbs = Math.abs(ms);
140
- if (msAbs >= d) {
141
- return plural(ms, msAbs, d, 'day');
142
- }
143
- if (msAbs >= h) {
144
- return plural(ms, msAbs, h, 'hour');
145
- }
146
- if (msAbs >= m) {
147
- return plural(ms, msAbs, m, 'minute');
148
- }
149
- if (msAbs >= s) {
150
- return plural(ms, msAbs, s, 'second');
151
- }
152
- return ms + ' ms';
153
- }
154
-
155
- /**
156
- * Pluralization helper.
157
- */
158
-
159
- function plural(ms, msAbs, n, name) {
160
- var isPlural = msAbs >= n * 1.5;
161
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
162
- }
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 Vercel, Inc.
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.
@@ -1,38 +0,0 @@
1
- {
2
- "name": "ms",
3
- "version": "2.1.3",
4
- "description": "Tiny millisecond conversion utility",
5
- "repository": "vercel/ms",
6
- "main": "./index",
7
- "files": [
8
- "index.js"
9
- ],
10
- "scripts": {
11
- "precommit": "lint-staged",
12
- "lint": "eslint lib/* bin/*",
13
- "test": "mocha tests.js"
14
- },
15
- "eslintConfig": {
16
- "extends": "eslint:recommended",
17
- "env": {
18
- "node": true,
19
- "es6": true
20
- }
21
- },
22
- "lint-staged": {
23
- "*.js": [
24
- "npm run lint",
25
- "prettier --single-quote --write",
26
- "git add"
27
- ]
28
- },
29
- "license": "MIT",
30
- "devDependencies": {
31
- "eslint": "4.18.2",
32
- "expect.js": "0.3.1",
33
- "husky": "0.14.3",
34
- "lint-staged": "5.0.0",
35
- "mocha": "4.0.1",
36
- "prettier": "2.0.5"
37
- }
38
- }
@@ -1,59 +0,0 @@
1
- # ms
2
-
3
- ![CI](https://github.com/vercel/ms/workflows/CI/badge.svg)
4
-
5
- Use this package to easily convert various time formats to milliseconds.
6
-
7
- ## Examples
8
-
9
- ```js
10
- ms('2 days') // 172800000
11
- ms('1d') // 86400000
12
- ms('10h') // 36000000
13
- ms('2.5 hrs') // 9000000
14
- ms('2h') // 7200000
15
- ms('1m') // 60000
16
- ms('5s') // 5000
17
- ms('1y') // 31557600000
18
- ms('100') // 100
19
- ms('-3 days') // -259200000
20
- ms('-1h') // -3600000
21
- ms('-200') // -200
22
- ```
23
-
24
- ### Convert from Milliseconds
25
-
26
- ```js
27
- ms(60000) // "1m"
28
- ms(2 * 60000) // "2m"
29
- ms(-3 * 60000) // "-3m"
30
- ms(ms('10 hours')) // "10h"
31
- ```
32
-
33
- ### Time Format Written-Out
34
-
35
- ```js
36
- ms(60000, { long: true }) // "1 minute"
37
- ms(2 * 60000, { long: true }) // "2 minutes"
38
- ms(-3 * 60000, { long: true }) // "-3 minutes"
39
- ms(ms('10 hours'), { long: true }) // "10 hours"
40
- ```
41
-
42
- ## Features
43
-
44
- - Works both in [Node.js](https://nodejs.org) and in the browser
45
- - If a number is supplied to `ms`, a string with a unit is returned
46
- - If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
47
- - If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
48
-
49
- ## Related Packages
50
-
51
- - [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
52
-
53
- ## Caught a Bug?
54
-
55
- 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
56
- 2. Link the package to the global module directory: `npm link`
57
- 3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
58
-
59
- As always, you can run the tests using: `npm test`