@chainlink/external-adapter-framework 2.12.0 → 2.13.1

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 (173) hide show
  1. package/README.md +1 -1
  2. package/config/index.d.ts +9 -0
  3. package/config/index.js +12 -1
  4. package/config/index.js.map +1 -1
  5. package/generator-adapter/generators/app/templates/src/config/index.ts.ejs +3 -0
  6. package/generator-adapter/node_modules/.yarn-integrity +31 -35
  7. package/generator-adapter/node_modules/@inquirer/ansi/package.json +28 -26
  8. package/generator-adapter/node_modules/@inquirer/checkbox/dist/index.d.ts +6 -1
  9. package/generator-adapter/node_modules/@inquirer/checkbox/dist/index.js +30 -10
  10. package/generator-adapter/node_modules/@inquirer/checkbox/package.json +23 -21
  11. package/generator-adapter/node_modules/@inquirer/confirm/package.json +21 -19
  12. package/generator-adapter/node_modules/@inquirer/core/dist/index.d.ts +1 -1
  13. package/generator-adapter/node_modules/@inquirer/core/dist/index.js +1 -1
  14. package/generator-adapter/node_modules/@inquirer/core/dist/lib/create-prompt.js +51 -25
  15. package/generator-adapter/node_modules/@inquirer/core/dist/lib/key.d.ts +2 -0
  16. package/generator-adapter/node_modules/@inquirer/core/dist/lib/key.js +1 -0
  17. package/generator-adapter/node_modules/@inquirer/core/dist/lib/utils.js +1 -1
  18. package/generator-adapter/node_modules/@inquirer/core/package.json +22 -20
  19. package/generator-adapter/node_modules/@inquirer/editor/dist/index.d.ts +3 -0
  20. package/generator-adapter/node_modules/@inquirer/editor/dist/index.js +5 -5
  21. package/generator-adapter/node_modules/@inquirer/editor/package.json +22 -20
  22. package/generator-adapter/node_modules/@inquirer/expand/package.json +21 -19
  23. package/generator-adapter/node_modules/@inquirer/external-editor/package.json +33 -31
  24. package/generator-adapter/node_modules/@inquirer/figures/package.json +18 -16
  25. package/generator-adapter/node_modules/@inquirer/input/dist/index.js +5 -3
  26. package/generator-adapter/node_modules/@inquirer/input/package.json +21 -19
  27. package/generator-adapter/node_modules/@inquirer/number/package.json +21 -19
  28. package/generator-adapter/node_modules/@inquirer/password/dist/index.d.ts +6 -1
  29. package/generator-adapter/node_modules/@inquirer/password/dist/index.js +7 -2
  30. package/generator-adapter/node_modules/@inquirer/password/package.json +22 -20
  31. package/generator-adapter/node_modules/@inquirer/prompts/README.md +15 -0
  32. package/generator-adapter/node_modules/@inquirer/prompts/package.json +31 -29
  33. package/generator-adapter/node_modules/@inquirer/rawlist/README.md +4 -0
  34. package/generator-adapter/node_modules/@inquirer/rawlist/dist/index.d.ts +9 -2
  35. package/generator-adapter/node_modules/@inquirer/rawlist/dist/index.js +24 -7
  36. package/generator-adapter/node_modules/@inquirer/rawlist/package.json +21 -19
  37. package/generator-adapter/node_modules/@inquirer/search/README.md +2 -1
  38. package/generator-adapter/node_modules/@inquirer/search/dist/index.d.ts +1 -0
  39. package/generator-adapter/node_modules/@inquirer/search/dist/index.js +11 -4
  40. package/generator-adapter/node_modules/@inquirer/search/package.json +22 -20
  41. package/generator-adapter/node_modules/@inquirer/select/dist/index.d.ts +5 -2
  42. package/generator-adapter/node_modules/@inquirer/select/dist/index.js +28 -11
  43. package/generator-adapter/node_modules/@inquirer/select/package.json +23 -21
  44. package/generator-adapter/node_modules/@inquirer/type/package.json +18 -16
  45. package/generator-adapter/node_modules/@types/node/README.md +1 -1
  46. package/generator-adapter/node_modules/@types/node/http.d.ts +1 -1
  47. package/generator-adapter/node_modules/@types/node/package.json +2 -2
  48. package/generator-adapter/node_modules/@types/node/stream/web.d.ts +1 -1
  49. package/generator-adapter/node_modules/@types/node/test.d.ts +2 -1
  50. package/generator-adapter/node_modules/@types/node/web-globals/fetch.d.ts +12 -0
  51. package/generator-adapter/node_modules/@yeoman/adapter/dist/adapter.d.ts +0 -3
  52. package/generator-adapter/node_modules/@yeoman/adapter/dist/adapter.js +1 -0
  53. package/generator-adapter/node_modules/@yeoman/adapter/dist/adapter.js.map +1 -1
  54. package/generator-adapter/node_modules/@yeoman/adapter/dist/log.d.ts +0 -2
  55. package/generator-adapter/node_modules/@yeoman/adapter/dist/log.js.map +1 -1
  56. package/generator-adapter/node_modules/@yeoman/adapter/dist/queued-adapter.d.ts +0 -1
  57. package/generator-adapter/node_modules/@yeoman/adapter/dist/queued-adapter.js.map +1 -1
  58. package/generator-adapter/node_modules/@yeoman/adapter/dist/testing/test-adapter.d.ts +0 -1
  59. package/generator-adapter/node_modules/@yeoman/adapter/dist/testing/test-adapter.js.map +1 -1
  60. package/generator-adapter/node_modules/@yeoman/adapter/package.json +11 -11
  61. package/generator-adapter/node_modules/ansi-styles/index.d.ts +341 -232
  62. package/generator-adapter/node_modules/ansi-styles/index.js +130 -190
  63. package/generator-adapter/node_modules/ansi-styles/license +1 -1
  64. package/generator-adapter/node_modules/ansi-styles/package.json +10 -8
  65. package/generator-adapter/node_modules/ansi-styles/readme.md +32 -53
  66. package/generator-adapter/node_modules/chalk/package.json +3 -3
  67. package/generator-adapter/node_modules/chalk/readme.md +25 -53
  68. package/generator-adapter/node_modules/chalk/source/index.d.ts +6 -1
  69. package/generator-adapter/node_modules/chalk/source/vendor/supports-color/browser.js +6 -2
  70. package/generator-adapter/node_modules/chalk/source/vendor/supports-color/index.js +10 -2
  71. package/generator-adapter/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  72. package/generator-adapter/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  73. package/generator-adapter/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  74. package/generator-adapter/node_modules/{p-queue/dist/options copy.js → fast-string-truncated-width/dist/types.js} +1 -0
  75. package/generator-adapter/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  76. package/generator-adapter/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  77. package/generator-adapter/node_modules/fast-string-truncated-width/license +21 -0
  78. package/generator-adapter/node_modules/fast-string-truncated-width/package.json +35 -0
  79. package/generator-adapter/node_modules/fast-string-truncated-width/readme.md +59 -0
  80. package/generator-adapter/node_modules/fast-string-width/dist/index.d.ts +4 -0
  81. package/generator-adapter/node_modules/fast-string-width/dist/index.js +14 -0
  82. package/generator-adapter/node_modules/fast-string-width/license +21 -0
  83. package/generator-adapter/node_modules/fast-string-width/package.json +34 -0
  84. package/generator-adapter/node_modules/fast-string-width/readme.md +42 -0
  85. package/generator-adapter/node_modules/fast-wrap-ansi/LICENSE +23 -0
  86. package/generator-adapter/node_modules/fast-wrap-ansi/README.md +26 -0
  87. package/generator-adapter/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  88. package/generator-adapter/node_modules/fast-wrap-ansi/lib/main.js +219 -0
  89. package/generator-adapter/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
  90. package/generator-adapter/node_modules/fast-wrap-ansi/package.json +51 -0
  91. package/generator-adapter/node_modules/iconv-lite/lib/index.d.ts +114 -26
  92. package/generator-adapter/node_modules/iconv-lite/lib/index.js +39 -40
  93. package/generator-adapter/node_modules/iconv-lite/package.json +13 -2
  94. package/generator-adapter/node_modules/iconv-lite/types/encodings.d.ts +423 -0
  95. package/generator-adapter/node_modules/inquirer/dist/types.d.ts +12 -11
  96. package/generator-adapter/node_modules/inquirer/dist/ui/prompt.js +9 -1
  97. package/generator-adapter/node_modules/inquirer/dist/ui/skipped-renderer.d.ts +13 -0
  98. package/generator-adapter/node_modules/inquirer/dist/ui/skipped-renderer.js +57 -0
  99. package/generator-adapter/node_modules/inquirer/package.json +21 -19
  100. package/generator-adapter/node_modules/log-symbols/package.json +1 -1
  101. package/generator-adapter/node_modules/log-symbols/symbols.js +1 -1
  102. package/generator-adapter/node_modules/mem-fs/dist/index.d.ts +0 -2
  103. package/generator-adapter/node_modules/mem-fs/node_modules/vinyl/LICENSE +21 -0
  104. package/generator-adapter/node_modules/mem-fs/node_modules/vinyl/README.md +447 -0
  105. package/generator-adapter/node_modules/mem-fs/node_modules/vinyl/index.js +346 -0
  106. package/generator-adapter/node_modules/mem-fs/node_modules/vinyl/lib/inspect-stream.js +13 -0
  107. package/generator-adapter/node_modules/mem-fs/node_modules/vinyl/lib/is-stream.js +15 -0
  108. package/generator-adapter/node_modules/mem-fs/node_modules/vinyl/lib/normalize.js +9 -0
  109. package/generator-adapter/node_modules/mem-fs/node_modules/vinyl/package.json +59 -0
  110. package/generator-adapter/node_modules/mem-fs/package.json +9 -9
  111. package/generator-adapter/node_modules/ora/index.d.ts +3 -1
  112. package/generator-adapter/node_modules/ora/index.js +299 -109
  113. package/generator-adapter/node_modules/ora/package.json +3 -4
  114. package/generator-adapter/node_modules/ora/readme.md +24 -0
  115. package/generator-adapter/node_modules/p-queue/dist/index.js +145 -22
  116. package/generator-adapter/node_modules/p-queue/dist/options.d.ts +17 -1
  117. package/generator-adapter/node_modules/p-queue/package.json +1 -1
  118. package/generator-adapter/node_modules/p-queue/readme.md +32 -1
  119. package/generator-adapter/node_modules/stdin-discarder/index.js +50 -22
  120. package/generator-adapter/node_modules/stdin-discarder/package.json +1 -1
  121. package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/package.json +3 -3
  122. package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/readme.md +53 -25
  123. package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/index.d.ts +1 -6
  124. package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/vendor/supports-color/browser.js +2 -6
  125. package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/vendor/supports-color/index.js +2 -10
  126. package/generator-adapter/package.json +3 -3
  127. package/package.json +12 -12
  128. package/transports/websocket.d.ts +5 -0
  129. package/transports/websocket.js +25 -13
  130. package/transports/websocket.js.map +1 -1
  131. package/generator-adapter/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
  132. package/generator-adapter/node_modules/emoji-regex/README.md +0 -107
  133. package/generator-adapter/node_modules/emoji-regex/index.d.ts +0 -3
  134. package/generator-adapter/node_modules/emoji-regex/index.js +0 -4
  135. package/generator-adapter/node_modules/emoji-regex/index.mjs +0 -4
  136. package/generator-adapter/node_modules/emoji-regex/package.json +0 -45
  137. package/generator-adapter/node_modules/iconv-lite/Changelog.md +0 -236
  138. package/generator-adapter/node_modules/jake/node_modules/ansi-styles/index.d.ts +0 -345
  139. package/generator-adapter/node_modules/jake/node_modules/ansi-styles/index.js +0 -163
  140. package/generator-adapter/node_modules/jake/node_modules/ansi-styles/license +0 -9
  141. package/generator-adapter/node_modules/jake/node_modules/ansi-styles/package.json +0 -56
  142. package/generator-adapter/node_modules/jake/node_modules/ansi-styles/readme.md +0 -152
  143. package/generator-adapter/node_modules/ora/node_modules/log-symbols/browser-symbols.js +0 -4
  144. package/generator-adapter/node_modules/ora/node_modules/log-symbols/browser.js +0 -1
  145. package/generator-adapter/node_modules/ora/node_modules/log-symbols/index.d.ts +0 -22
  146. package/generator-adapter/node_modules/ora/node_modules/log-symbols/index.js +0 -1
  147. package/generator-adapter/node_modules/ora/node_modules/log-symbols/license +0 -9
  148. package/generator-adapter/node_modules/ora/node_modules/log-symbols/package.json +0 -60
  149. package/generator-adapter/node_modules/ora/node_modules/log-symbols/readme.md +0 -39
  150. package/generator-adapter/node_modules/ora/node_modules/log-symbols/symbols.js +0 -14
  151. package/generator-adapter/node_modules/ora/node_modules/strip-ansi/index.d.ts +0 -15
  152. package/generator-adapter/node_modules/ora/node_modules/strip-ansi/index.js +0 -14
  153. package/generator-adapter/node_modules/ora/node_modules/strip-ansi/license +0 -9
  154. package/generator-adapter/node_modules/ora/node_modules/strip-ansi/package.json +0 -59
  155. package/generator-adapter/node_modules/ora/node_modules/strip-ansi/readme.md +0 -37
  156. package/generator-adapter/node_modules/p-queue/dist/options copy.d.ts +0 -121
  157. package/generator-adapter/node_modules/wrap-ansi/index.d.ts +0 -41
  158. package/generator-adapter/node_modules/wrap-ansi/index.js +0 -222
  159. package/generator-adapter/node_modules/wrap-ansi/license +0 -9
  160. package/generator-adapter/node_modules/wrap-ansi/node_modules/string-width/index.d.ts +0 -39
  161. package/generator-adapter/node_modules/wrap-ansi/node_modules/string-width/index.js +0 -82
  162. package/generator-adapter/node_modules/wrap-ansi/node_modules/string-width/license +0 -9
  163. package/generator-adapter/node_modules/wrap-ansi/node_modules/string-width/package.json +0 -64
  164. package/generator-adapter/node_modules/wrap-ansi/node_modules/string-width/readme.md +0 -66
  165. package/generator-adapter/node_modules/wrap-ansi/package.json +0 -69
  166. package/generator-adapter/node_modules/wrap-ansi/readme.md +0 -75
  167. /package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/license +0 -0
  168. /package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/index.js +0 -0
  169. /package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/utilities.js +0 -0
  170. /package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -0
  171. /package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -0
  172. /package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -0
  173. /package/generator-adapter/node_modules/{ora → yeoman-generator}/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inquirer",
3
- "version": "13.0.1",
3
+ "version": "13.3.0",
4
4
  "description": "A collection of common interactive command line user interfaces.",
5
5
  "keywords": [
6
6
  "answer",
@@ -42,32 +42,35 @@
42
42
  "zsh"
43
43
  ],
44
44
  "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/inquirer/README.md",
45
+ "license": "MIT",
46
+ "author": "Simon Boudrias <admin@simonboudrias.com>",
45
47
  "repository": {
46
48
  "type": "git",
47
49
  "url": "https://github.com/SBoudrias/Inquirer.js.git"
48
50
  },
49
- "license": "MIT",
50
- "author": "Simon Boudrias <admin@simonboudrias.com>",
51
- "sideEffects": false,
51
+ "files": [
52
+ "dist"
53
+ ],
52
54
  "type": "module",
55
+ "sideEffects": false,
53
56
  "exports": {
54
- "./package.json": "./package.json",
55
57
  ".": {
56
58
  "types": "./dist/index.d.ts",
57
59
  "default": "./dist/index.js"
58
- }
60
+ },
61
+ "./package.json": "./package.json"
62
+ },
63
+ "publishConfig": {
64
+ "access": "public"
59
65
  },
60
- "files": [
61
- "dist"
62
- ],
63
66
  "scripts": {
64
67
  "tsc": "tsc"
65
68
  },
66
69
  "dependencies": {
67
- "@inquirer/ansi": "^2.0.1",
68
- "@inquirer/core": "^11.0.1",
69
- "@inquirer/prompts": "^8.0.1",
70
- "@inquirer/type": "^4.0.1",
70
+ "@inquirer/ansi": "^2.0.3",
71
+ "@inquirer/core": "^11.1.5",
72
+ "@inquirer/prompts": "^8.3.0",
73
+ "@inquirer/type": "^4.0.3",
71
74
  "mute-stream": "^3.0.0",
72
75
  "run-async": "^4.0.6",
73
76
  "rxjs": "^7.8.2"
@@ -76,9 +79,6 @@
76
79
  "@types/mute-stream": "^0.0.4",
77
80
  "typescript": "^5.9.3"
78
81
  },
79
- "engines": {
80
- "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0"
81
- },
82
82
  "peerDependencies": {
83
83
  "@types/node": ">=18"
84
84
  },
@@ -87,8 +87,10 @@
87
87
  "optional": true
88
88
  }
89
89
  },
90
- "publishConfig": {
91
- "access": "public"
90
+ "engines": {
91
+ "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0"
92
92
  },
93
- "gitHead": "cce79ce3b9bbdfb4dbb798078cf3b94b9adc7d1b"
93
+ "main": "./dist/index.js",
94
+ "types": "./dist/index.d.ts",
95
+ "gitHead": "526eca2e64853510821ffd457561840ec0cbfb93"
94
96
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "log-symbols",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Colored symbols for various log levels. Example: `✔︎ Success`",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/log-symbols",
@@ -11,4 +11,4 @@ const _isUnicodeSupported = isUnicodeSupported();
11
11
  export const info = blue(_isUnicodeSupported ? 'ℹ' : 'i');
12
12
  export const success = green(_isUnicodeSupported ? '✔' : '√');
13
13
  export const warning = yellow(_isUnicodeSupported ? '⚠' : '‼');
14
- export const error = red(_isUnicodeSupported ? '✖️' : '×');
14
+ export const error = red(_isUnicodeSupported ? '' : '×');
@@ -1,5 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
1
  import { EventEmitter } from 'events';
4
2
  import File from 'vinyl';
5
3
  import { type PipelineTransform, Readable } from 'stream';
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013, 2016-2022 Blaine Bublitz <blaine.bublitz@gmail.com> and Eric Schoffstall <yo@contra.io>
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,447 @@
1
+ <p align="center">
2
+ <a href="https://gulpjs.com">
3
+ <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
4
+ </a>
5
+ </p>
6
+
7
+ # vinyl
8
+
9
+ [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]
10
+
11
+ Virtual file format.
12
+
13
+ ## What is Vinyl?
14
+
15
+ Vinyl is a very simple metadata object that describes a file. When you think of a file, two attributes come to mind: `path` and `contents`. These are the main attributes on a Vinyl object. A file does not necessarily represent something on your computer’s file system. You have files on S3, FTP, Dropbox, Box, CloudThingly.io and other services. Vinyl can be used to describe files from all of these sources.
16
+
17
+ ## What is a Vinyl Adapter?
18
+
19
+ While Vinyl provides a clean way to describe a file, we also need a way to access these files. Each file source needs what I call a "Vinyl adapter". A Vinyl adapter simply exposes a `src(globs)` and a `dest(folder)` method. Each return a stream. The `src` stream produces Vinyl objects, and the `dest` stream consumes Vinyl objects. Vinyl adapters can expose extra methods that might be specific to their input/output medium, such as the `symlink` method [`vinyl-fs`][vinyl-fs] provides.
20
+
21
+ ## Usage
22
+
23
+ ```js
24
+ var Vinyl = require('vinyl');
25
+
26
+ var jsFile = new Vinyl({
27
+ cwd: '/',
28
+ base: '/test/',
29
+ path: '/test/file.js',
30
+ contents: Buffer.from('var x = 123'),
31
+ });
32
+ ```
33
+
34
+ ## API
35
+
36
+ ### `new Vinyl([options])`
37
+
38
+ The constructor is used to create a new instance of `Vinyl`. Each instance represents a separate file, directory or symlink.
39
+
40
+ All internally managed paths (`cwd`, `base`, `path`, `history`) are normalized and have trailing separators removed. See [Normalization and concatenation][normalization] for more information.
41
+
42
+ Options may be passed upon instantiation to create a file with specific properties.
43
+
44
+ #### `options`
45
+
46
+ Options are not mutated by the constructor.
47
+
48
+ ##### `options.cwd`
49
+
50
+ The current working directory of the file.
51
+
52
+ Type: `String`
53
+
54
+ Default: `process.cwd()`
55
+
56
+ ##### `options.base`
57
+
58
+ Used for calculating the `relative` property. This is typically where a glob starts.
59
+
60
+ Type: `String`
61
+
62
+ Default: `options.cwd`
63
+
64
+ ##### `options.path`
65
+
66
+ The full path to the file.
67
+
68
+ Type: `String`
69
+
70
+ Default: `undefined`
71
+
72
+ ##### `options.history`
73
+
74
+ Stores the path history. If `options.path` and `options.history` are both passed, `options.path` is appended to `options.history`. All `options.history` paths are normalized by the `file.path` setter.
75
+
76
+ Type: `Array`
77
+
78
+ Default: `[]` (or `[options.path]` if `options.path` is passed)
79
+
80
+ ##### `options.stat`
81
+
82
+ The result of an `fs.stat` call. This is how you mark the file as a directory or symbolic link. See [isDirectory()][is-directory], [isSymbolic()][is-symbolic] and [fs.Stats][fs-stats] for more information.
83
+
84
+ Type: [`fs.Stats`][fs-stats]
85
+
86
+ Default: `undefined`
87
+
88
+ ##### `options.contents`
89
+
90
+ The contents of the file. If `options.contents` is a [`ReadableStream`][readable-stream], it is wrapped in a [`cloneable-readable`][cloneable-readable] stream.
91
+
92
+ Type: [`ReadableStream`][readable-stream], [`Buffer`][buffer], or `null`
93
+
94
+ Default: `null`
95
+
96
+ ##### `options.{custom}`
97
+
98
+ Any other option properties will be directly assigned to the new Vinyl object.
99
+
100
+ ```js
101
+ var Vinyl = require('vinyl');
102
+
103
+ var file = new Vinyl({ foo: 'bar' });
104
+ file.foo === 'bar'; // true
105
+ ```
106
+
107
+ ### Instance methods
108
+
109
+ Each Vinyl object will have instance methods. Every method will be available but may return differently based on what properties were set upon instantiation or modified since.
110
+
111
+ #### `file.isBuffer()`
112
+
113
+ Returns `true` if the file contents are a [`Buffer`][buffer], otherwise `false`.
114
+
115
+ #### `file.isStream()`
116
+
117
+ Returns `true` if the file contents are a [`Stream`][stream], otherwise `false`.
118
+
119
+ #### `file.isNull()`
120
+
121
+ Returns `true` if the file contents are `null`, otherwise `false`.
122
+
123
+ #### `file.isDirectory()`
124
+
125
+ Returns `true` if the file represents a directory, otherwise `false`.
126
+
127
+ A file is considered a directory when:
128
+
129
+ - `file.isNull()` is `true`
130
+ - `file.stat` is an object
131
+ - `file.stat.isDirectory()` returns `true`
132
+
133
+ When constructing a Vinyl object, pass in a valid [`fs.Stats`][fs-stats] object via `options.stat`. If you are mocking the [`fs.Stats`][fs-stats] object, you may need to stub the `isDirectory()` method.
134
+
135
+ #### `file.isSymbolic()`
136
+
137
+ Returns `true` if the file represents a symbolic link, otherwise `false`.
138
+
139
+ A file is considered symbolic when:
140
+
141
+ - `file.isNull()` is `true`
142
+ - `file.stat` is an object
143
+ - `file.stat.isSymbolicLink()` returns `true`
144
+
145
+ When constructing a Vinyl object, pass in a valid [`fs.Stats`][fs-stats] object via `options.stat`. If you are mocking the [`fs.Stats`][fs-stats] object, you may need to stub the `isSymbolicLink()` method.
146
+
147
+ #### `file.clone([options])`
148
+
149
+ Returns a new Vinyl object with all attributes cloned.
150
+
151
+ **By default custom attributes are cloned deeply.**
152
+
153
+ If `options` or `options.deep` is `false`, custom attributes will not be cloned deeply.
154
+
155
+ If `file.contents` is a [`Buffer`][buffer] and `options.contents` is `false`, the [`Buffer`][buffer] reference will be reused instead of copied.
156
+
157
+ #### `file.inspect()`
158
+
159
+ Returns a formatted-string interpretation of the Vinyl object. Automatically called by node's `console.log`.
160
+
161
+ ### Instance properties
162
+
163
+ Each Vinyl object will have instance properties. Some may be unavailable based on what properties were set upon instantiation or modified since.
164
+
165
+ #### `file.contents`
166
+
167
+ Gets and sets the contents of the file. If set to a [`ReadableStream`][readable-stream], it is wrapped in a [`cloneable-readable`][cloneable-readable] stream.
168
+
169
+ Throws when set to any value other than a [`ReadableStream`][readable-stream], a [`Buffer`][buffer] or `null`.
170
+
171
+ Type: [`ReadableStream`][readable-stream], [`Buffer`][buffer], or `null`
172
+
173
+ #### `file.cwd`
174
+
175
+ Gets and sets current working directory. Will always be normalized and have trailing separators removed.
176
+
177
+ Throws when set to any value other than non-empty strings.
178
+
179
+ Type: `String`
180
+
181
+ #### `file.base`
182
+
183
+ Gets and sets base directory. Used for relative pathing (typically where a glob starts).
184
+ When `null` or `undefined`, it simply proxies the `file.cwd` property. Will always be normalized and have trailing separators removed.
185
+
186
+ Throws when set to any value other than non-empty strings or `null`/`undefined`.
187
+
188
+ Type: `String`
189
+
190
+ #### `file.path`
191
+
192
+ Gets and sets the absolute pathname string or `undefined`. Setting to a different value appends the new path to `file.history`. If set to the same value as the current path, it is ignored. All new values are normalized and have trailing separators removed.
193
+
194
+ Throws when set to any value other than a string.
195
+
196
+ Type: `String`
197
+
198
+ #### `file.history`
199
+
200
+ Array of `file.path` values the Vinyl object has had, from `file.history[0]` (original) through `file.history[file.history.length - 1]` (current). `file.history` and its elements should normally be treated as read-only and only altered indirectly by setting `file.path`.
201
+
202
+ Type: `Array`
203
+
204
+ #### `file.relative`
205
+
206
+ Gets the result of `path.relative(file.base, file.path)`.
207
+
208
+ Throws when set or when `file.path` is not set.
209
+
210
+ Type: `String`
211
+
212
+ Example:
213
+
214
+ ```js
215
+ var file = new File({
216
+ cwd: '/',
217
+ base: '/test/',
218
+ path: '/test/file.js',
219
+ });
220
+
221
+ console.log(file.relative); // file.js
222
+ ```
223
+
224
+ #### `file.dirname`
225
+
226
+ Gets and sets the dirname of `file.path`. Will always be normalized and have trailing separators removed.
227
+
228
+ Throws when `file.path` is not set.
229
+
230
+ Type: `String`
231
+
232
+ Example:
233
+
234
+ ```js
235
+ var file = new File({
236
+ cwd: '/',
237
+ base: '/test/',
238
+ path: '/test/file.js',
239
+ });
240
+
241
+ console.log(file.dirname); // /test
242
+
243
+ file.dirname = '/specs';
244
+
245
+ console.log(file.dirname); // /specs
246
+ console.log(file.path); // /specs/file.js
247
+ ```
248
+
249
+ #### `file.basename`
250
+
251
+ Gets and sets the basename of `file.path`.
252
+
253
+ Throws when `file.path` is not set.
254
+
255
+ Type: `String`
256
+
257
+ Example:
258
+
259
+ ```js
260
+ var file = new File({
261
+ cwd: '/',
262
+ base: '/test/',
263
+ path: '/test/file.js',
264
+ });
265
+
266
+ console.log(file.basename); // file.js
267
+
268
+ file.basename = 'file.txt';
269
+
270
+ console.log(file.basename); // file.txt
271
+ console.log(file.path); // /test/file.txt
272
+ ```
273
+
274
+ #### `file.stem`
275
+
276
+ Gets and sets stem (filename without suffix) of `file.path`.
277
+
278
+ Throws when `file.path` is not set.
279
+
280
+ Type: `String`
281
+
282
+ Example:
283
+
284
+ ```js
285
+ var file = new File({
286
+ cwd: '/',
287
+ base: '/test/',
288
+ path: '/test/file.js',
289
+ });
290
+
291
+ console.log(file.stem); // file
292
+
293
+ file.stem = 'foo';
294
+
295
+ console.log(file.stem); // foo
296
+ console.log(file.path); // /test/foo.js
297
+ ```
298
+
299
+ #### `file.extname`
300
+
301
+ Gets and sets extname of `file.path`.
302
+
303
+ Throws when `file.path` is not set.
304
+
305
+ Type: `String`
306
+
307
+ Example:
308
+
309
+ ```js
310
+ var file = new File({
311
+ cwd: '/',
312
+ base: '/test/',
313
+ path: '/test/file.js',
314
+ });
315
+
316
+ console.log(file.extname); // .js
317
+
318
+ file.extname = '.txt';
319
+
320
+ console.log(file.extname); // .txt
321
+ console.log(file.path); // /test/file.txt
322
+ ```
323
+
324
+ #### `file.symlink`
325
+
326
+ Gets and sets the path where the file points to if it's a symbolic link. Will always be normalized and have trailing separators removed.
327
+
328
+ Throws when set to any value other than a string.
329
+
330
+ Type: `String`
331
+
332
+ ### `Vinyl.isVinyl(file)`
333
+
334
+ Static method used for checking if an object is a Vinyl file. Use this method instead of `instanceof`.
335
+
336
+ Takes an object and returns `true` if it is a Vinyl file, otherwise returns `false`.
337
+
338
+ **Note: This method uses an internal flag that some older versions of Vinyl didn't expose.**
339
+
340
+ Example:
341
+
342
+ ```js
343
+ var Vinyl = require('vinyl');
344
+
345
+ var file = new Vinyl();
346
+ var notAFile = {};
347
+
348
+ Vinyl.isVinyl(file); // true
349
+ Vinyl.isVinyl(notAFile); // false
350
+ ```
351
+
352
+ ### `Vinyl.isCustomProp(property)`
353
+
354
+ Static method used by Vinyl when setting values inside the constructor or when copying properties in `file.clone()`.
355
+
356
+ Takes a string `property` and returns `true` if the property is not used internally, otherwise returns `false`.
357
+
358
+ This method is useful for inheritting from the Vinyl constructor. Read more in [Extending Vinyl][extending-vinyl].
359
+
360
+ Example:
361
+
362
+ ```js
363
+ var Vinyl = require('vinyl');
364
+
365
+ Vinyl.isCustomProp('sourceMap'); // true
366
+ Vinyl.isCustomProp('path'); // false -> internal getter/setter
367
+ ```
368
+
369
+ ## Normalization and concatenation
370
+
371
+ Since all properties are normalized in their setters, you can just concatenate with `/`, and normalization takes care of it properly on all platforms.
372
+
373
+ Example:
374
+
375
+ ```js
376
+ var file = new File();
377
+ file.path = '/' + 'test' + '/' + 'foo.bar';
378
+
379
+ console.log(file.path);
380
+ // posix => /test/foo.bar
381
+ // win32 => \\test\\foo.bar
382
+ ```
383
+
384
+ But never concatenate with `\`, since that is a valid filename character on posix system.
385
+
386
+ ## Extending Vinyl
387
+
388
+ When extending Vinyl into your own class with extra features, you need to think about a few things.
389
+
390
+ When you have your own properties that are managed internally, you need to extend the static `isCustomProp` method to return `false` when one of these properties is queried.
391
+
392
+ ```js
393
+ var Vinyl = require('vinyl');
394
+
395
+ var builtInProps = ['foo', '_foo'];
396
+
397
+ class SuperFile extends Vinyl {
398
+ constructor(options) {
399
+ super(options);
400
+ this._foo = 'example internal read-only value';
401
+ }
402
+
403
+ get foo() {
404
+ return this._foo;
405
+ }
406
+
407
+ static isCustomProp(name) {
408
+ return super.isCustomProp(name) && builtInProps.indexOf(name) === -1;
409
+ }
410
+ }
411
+
412
+ // `foo` won't be assigned to the object below
413
+ new SuperFile({ foo: 'something' });
414
+ ```
415
+
416
+ This makes properties `foo` and `_foo` skipped when passed in options to `constructor(options)` so they don't get assigned to the new object and override your custom implementation. They also won't be copied when cloning. **Note:** The `_foo` and `foo` properties will still exist on the created/cloned object because you are assigning `_foo` in the constructor and `foo` is defined on the prototype.
417
+
418
+ Same goes for `clone()`. If you have your own internal stuff that needs special handling during cloning, you should extend it to do so.
419
+
420
+ ## License
421
+
422
+ MIT
423
+
424
+ <!-- prettier-ignore-start -->
425
+ [downloads-image]: https://img.shields.io/npm/dm/vinyl.svg?style=flat-square
426
+ [npm-url]: https://www.npmjs.com/package/vinyl
427
+ [npm-image]: https://img.shields.io/npm/v/vinyl.svg?style=flat-square
428
+
429
+ [ci-url]: https://github.com/gulpjs/vinyl/actions?query=workflow:dev
430
+ [ci-image]: https://img.shields.io/github/actions/workflow/status/gulpjs/vinyl/dev.yml?branch=master&style=flat-square
431
+
432
+ [coveralls-url]: https://coveralls.io/r/gulpjs/vinyl
433
+ [coveralls-image]: https://img.shields.io/coveralls/gulpjs/vinyl/master.svg?style=flat-square
434
+ <!-- prettier-ignore-end -->
435
+
436
+ <!-- prettier-ignore-start -->
437
+ [is-symbolic]: #issymbolic
438
+ [is-directory]: #isdirectory
439
+ [normalization]: #normalization-and-concatenation
440
+ [extending-vinyl]: #extending-vinyl
441
+ [stream]: https://nodejs.org/api/stream.html#stream_stream
442
+ [readable-stream]: https://nodejs.org/api/stream.html#stream_readable_streams
443
+ [buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer
444
+ [fs-stats]: https://nodejs.org/api/fs.html#fs_class_fs_stats
445
+ [vinyl-fs]: https://github.com/gulpjs/vinyl-fs
446
+ [cloneable-readable]: https://github.com/mcollina/cloneable-readable
447
+ <!-- prettier-ignore-end -->