comfy-ts 0.2.0 → 0.3.0

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 (158) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +363 -0
  3. package/dist/cli.js +764 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/index.cjs +4128 -0
  6. package/dist/index.cjs.map +1 -0
  7. package/dist/index.d.cts +9862 -0
  8. package/dist/index.d.ts +9846 -58
  9. package/dist/index.js +4049 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/log-CdfgILde.js +10 -0
  12. package/dist/log-CdfgILde.js.map +1 -0
  13. package/dist/run-tui-Io8Xea0L.js +3340 -0
  14. package/dist/run-tui-Io8Xea0L.js.map +1 -0
  15. package/package.json +104 -75
  16. package/src/cli/comfy-ts-cli.ts +36 -0
  17. package/src/cli/gen.ts +47 -0
  18. package/src/cli/outline.ts +82 -0
  19. package/src/cli/tui/components/DraftsOverlay.tsx +44 -0
  20. package/src/cli/tui/components/EditField.tsx +27 -0
  21. package/src/cli/tui/components/Header.tsx +51 -0
  22. package/src/cli/tui/components/HostPanel.tsx +37 -0
  23. package/src/cli/tui/components/LorasOverlay.tsx +49 -0
  24. package/src/cli/tui/components/OverlayList.tsx +25 -0
  25. package/src/cli/tui/components/PickerOverlays.tsx +66 -0
  26. package/src/cli/tui/components/PreviewPanel.tsx +33 -0
  27. package/src/cli/tui/components/PromptOverlay.tsx +16 -0
  28. package/src/cli/tui/components/StatusBar.tsx +165 -0
  29. package/src/cli/tui/components/TextOverlay.tsx +72 -0
  30. package/src/cli/tui/components/TreePanel.tsx +51 -0
  31. package/src/cli/tui/components/TuiApp.tsx +223 -0
  32. package/src/cli/tui/components/VarsPanel.tsx +86 -0
  33. package/src/cli/tui/findDefinedWorkflow.ts +16 -0
  34. package/src/cli/tui/keys.ts +20 -0
  35. package/src/cli/tui/protocolImagePainter.ts +59 -0
  36. package/src/cli/tui/run-tui.tsx +73 -0
  37. package/src/cli/tui/state/DraftsSt.ts +273 -0
  38. package/src/cli/tui/state/EditorSt.ts +289 -0
  39. package/src/cli/tui/state/ExecSt.ts +170 -0
  40. package/src/cli/tui/state/HostSt.ts +107 -0
  41. package/src/cli/tui/state/LorasSt.ts +185 -0
  42. package/src/cli/tui/state/PickerSt.ts +112 -0
  43. package/src/cli/tui/state/PreviewSt.ts +138 -0
  44. package/src/cli/tui/state/QueueSt.ts +59 -0
  45. package/src/cli/tui/state/SettingsSt.ts +73 -0
  46. package/src/cli/tui/state/TreeSt.ts +122 -0
  47. package/src/cli/tui/state/TuiSt.ts +169 -0
  48. package/src/cli/tui/state/WorkflowsSt.ts +92 -0
  49. package/src/cli/tui-env.ts +8 -0
  50. package/src/errors/InvalidPromptError.ts +12 -0
  51. package/src/graph/ComfyNode.ts +403 -0
  52. package/src/graph/ComfyNodeID.ts +28 -0
  53. package/src/graph/ComfyNodeOutput.ts +16 -0
  54. package/src/graph/NodeSlotSize.ts +4 -0
  55. package/src/graph/autoValue.ts +17 -0
  56. package/src/host/ComfyHost.ts +646 -0
  57. package/src/host/ComfyInstallType.ts +15 -0
  58. package/src/host/ComfyManager.ts +232 -0
  59. package/src/host/ComfyUploader.ts +110 -0
  60. package/src/host/ComfyWorkflowBuilder.ts +60 -0
  61. package/src/host/Requirements.ts +55 -0
  62. package/src/host/ResilientWebsocket.ts +147 -0
  63. package/src/host/loraManagerApi.ts +98 -0
  64. package/src/image-utils/_getPngMetadata.ts +53 -0
  65. package/src/image-utils/_getWebpMetadata.ts +38 -0
  66. package/src/image-utils/_parseExifData.ts +53 -0
  67. package/src/index.ts +89 -0
  68. package/src/litegraph/LiteGraphGroup.ts +22 -0
  69. package/src/litegraph/LiteGraphJSON.ts +46 -0
  70. package/src/litegraph/LiteGraphLink.ts +23 -0
  71. package/src/litegraph/LiteGraphLinkID.ts +6 -0
  72. package/src/litegraph/LiteGraphNode.ts +69 -0
  73. package/src/litegraph/LiteGraphNodeInput.ts +27 -0
  74. package/src/litegraph/LiteGraphNodeOutput.ts +23 -0
  75. package/src/litegraph/LiteGraphSlotIndex.ts +6 -0
  76. package/src/litegraph/convertFlowToLiteGraphJSON.ts +114 -0
  77. package/src/manager/ComfyRegistry.ts +124 -0
  78. package/src/manager/generated/KnownComfyCustomNodeName.ts +19280 -0
  79. package/src/manager/generated/KnownComfyPluginTitle.ts +5130 -0
  80. package/src/manager/generated/KnownComfyPluginURL.ts +2589 -0
  81. package/src/manager/generated/KnownModel_Base.ts +126 -0
  82. package/src/manager/generated/KnownModel_FileName.ts +2287 -0
  83. package/src/manager/generated/KnownModel_Name.ts +2287 -0
  84. package/src/manager/generated/KnownModel_SavePath.ts +263 -0
  85. package/src/manager/generated/KnownModel_Type.ts +97 -0
  86. package/src/manager/json/alter-list.json +224 -0
  87. package/src/manager/json/custom-node-list.extra.ts +13 -0
  88. package/src/manager/json/custom-node-list.json +21948 -0
  89. package/src/manager/json/extension-node-map.json +31282 -0
  90. package/src/manager/json/github-stats.json +12602 -0
  91. package/src/manager/json/model-list.extra.ts +26 -0
  92. package/src/manager/json/model-list.json +5052 -0
  93. package/src/manager/loaders/step1_downloadComfyManagerJSONs.ts +56 -0
  94. package/src/manager/loaders/step2_custom-node-list-loader.ts +149 -0
  95. package/src/manager/loaders/step3_extension-node-map-loader.ts +189 -0
  96. package/src/manager/loaders/step4_model-list-loader.ts +159 -0
  97. package/src/manager/script-update-manager.bun.ts +18 -0
  98. package/src/manager/types/ComfyManagerAPIFetchPolicy.ts +9 -0
  99. package/src/manager/types/ComfyManagerAPIModelList.ts +10 -0
  100. package/src/manager/types/ComfyManagerAPIPluginList.ts +11 -0
  101. package/src/manager/types/ComfyManagerFileModelInfo.ts +5 -0
  102. package/src/manager/types/ComfyManagerFilePluginContent.ts +13 -0
  103. package/src/manager/types/ComfyManagerFilePluginList.ts +5 -0
  104. package/src/manager/types/ComfyManagerModelInfo.ts +18 -0
  105. package/src/manager/types/ComfyManagerPluginContentMetadata.ts +16 -0
  106. package/src/manager/types/ComfyManagerPluginEnums.ts +8 -0
  107. package/src/manager/types/ComfyManagerPluginInfo.ts +50 -0
  108. package/src/runner/ComfyExecution.ts +301 -0
  109. package/src/runner/ComfyExecutionStatus.ts +2 -0
  110. package/src/runner/ComfyWorkflow.ts +395 -0
  111. package/src/runner/ComfyWorkflowLayout.ts +96 -0
  112. package/src/runner/ComfyWsApi.ts +159 -0
  113. package/src/runner/MediaImage.ts +262 -0
  114. package/src/sdk-generator/ComfyNodeSchema.ts +79 -0
  115. package/src/sdk-generator/ComfySchema.ts +369 -0
  116. package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +95 -0
  117. package/src/sdk-generator/Primitives.ts +76 -0
  118. package/src/sdk-generator/_getUnionNameBasedOnFirstFoundEnumName.ts +39 -0
  119. package/src/sdk-generator/_pythonModuleToNamespace.ts +27 -0
  120. package/src/sdk-generator/_toQualifiedNodeKey.ts +5 -0
  121. package/src/sdk-generator/comfy-api-json.ts +16 -0
  122. package/src/sdk-generator/comfyui-sdk-codegen.ts +287 -0
  123. package/src/sdk-generator/comfyui-types.ts +56 -0
  124. package/src/sdk-generator/litegraphToApiRequestPayload.ts +157 -0
  125. package/src/ssh-host-manager/ssh-config-manager.ts +89 -0
  126. package/src/ssh-host-manager/ssh-config.windows.md +32 -0
  127. package/src/ssh-host-manager/ssh-manager.ts +129 -0
  128. package/src/state.ts +136 -0
  129. package/src/types/comfy-sdk.ts +106 -0
  130. package/src/types/index.ts +55 -0
  131. package/src/utils/CodeBuffer.ts +61 -0
  132. package/src/utils/ComfyColors.ts +38 -0
  133. package/src/utils/ansi.ts +26 -0
  134. package/src/utils/ansiImage.ts +36 -0
  135. package/src/utils/bang.ts +39 -0
  136. package/src/utils/deepCopyNaive.ts +1 -0
  137. package/src/utils/downloadFile.ts +77 -0
  138. package/src/utils/escapeJSKey.ts +32 -0
  139. package/src/utils/exhaust.ts +4 -0
  140. package/src/utils/extractErrorMessage.ts +11 -0
  141. package/src/utils/fuzzyMatch.ts +8 -0
  142. package/src/utils/githubRegexes.ts +2 -0
  143. package/src/utils/hashArrayBuffer.ts +6 -0
  144. package/src/utils/log.ts +9 -0
  145. package/src/utils/loraTag.ts +10 -0
  146. package/src/utils/printArkResultInConsole.ts +16 -0
  147. package/src/utils/softValidate.ts +8 -0
  148. package/src/utils/stringifyReadable.ts +32 -0
  149. package/src/utils/toposort.ts +59 -0
  150. package/src/utils/tryExtracting.ts +41 -0
  151. package/src/utils/writeFile.ts +16 -0
  152. package/src/vars/ComfyVars.ts +531 -0
  153. package/src/vars/DefinedWorkflow.ts +112 -0
  154. package/src/vars/loraKeywords.ts +56 -0
  155. package/dist/index.d.mts +0 -74
  156. package/dist/index.mjs +0 -3
  157. package/dist/index.mjs.map +0 -1
  158. package/readme.md +0 -40
@@ -0,0 +1,77 @@
1
+ import fs, { mkdirSync } from 'node:fs'
2
+ import https from 'node:https'
3
+ import { stdout } from 'node:process'
4
+ import { dirname } from 'pathe'
5
+ import type { AbsolutePath } from 'src/types/index.ts'
6
+
7
+ /** Usage example
8
+ * | ;(async () => {
9
+ * | try {
10
+ * | await downloadFile('https://example.com/file', 'folder/filename')
11
+ * | console.log('Download completed successfully')
12
+ * | } catch (error) {
13
+ * | console.error('Download failed:', error)
14
+ * | }
15
+ * | })()
16
+ * |
17
+ */
18
+ export function downloadFile(
19
+ //
20
+ url: string,
21
+ outputPath: AbsolutePath | string,
22
+ logPrefix = ' - ',
23
+ ): Promise<true> {
24
+ const baseDir = dirname(outputPath)
25
+ mkdirSync(baseDir, { recursive: true })
26
+
27
+ return new Promise<true>((resolve, reject) => {
28
+ const request = https.get(url, (response) => {
29
+ // initial response --------------------------------------------
30
+ // Check for redirect
31
+ if (response.statusCode === 302 || response.statusCode === 301) {
32
+ // Follow the redirect and call downloadFile recursively
33
+ const newUrl = response.headers.location!
34
+ console.log(`Redirected to ${newUrl}`)
35
+ resolve(downloadFile(newUrl, outputPath))
36
+ return
37
+ }
38
+
39
+ if (response.statusCode !== 200) {
40
+ reject(`Failed to download file: Status Code ${response.statusCode}`)
41
+ return
42
+ }
43
+
44
+ // progress --------------------------------------------------
45
+ const rawLen = response.headers['content-length']
46
+ if (rawLen == null) {
47
+ console.warn(`download file: progress not available because no content-length header in response.`)
48
+ } else {
49
+ const totalSize = parseInt(rawLen, 10)
50
+ let downloaded = 0
51
+ let lastLoggedPercentage = 0
52
+
53
+ response.on('data', (chunk) => {
54
+ downloaded += chunk.length
55
+ const percentage = Math.round((downloaded / totalSize) * 100)
56
+ if (percentage >= lastLoggedPercentage + 1) {
57
+ // console.log(`${percentage}% downloaded`)
58
+ stdout.write(`\r${logPrefix}${percentage}% downloaded`)
59
+ lastLoggedPercentage = percentage
60
+ }
61
+ })
62
+ }
63
+
64
+ // file stream -------------------------------------------
65
+ const fileStream = fs.createWriteStream(outputPath)
66
+ response.pipe(fileStream)
67
+
68
+ fileStream.on('finish', () => {
69
+ console.log(` (DONE)`)
70
+ fileStream.close()
71
+ resolve(true)
72
+ })
73
+ })
74
+
75
+ request.on('error', (err) => reject(err))
76
+ })
77
+ }
@@ -0,0 +1,32 @@
1
+ const regex = /^[a-zA-Z_][a-zA-Z0-9_]*$/
2
+
3
+ const isValidJSKey = (s: string): boolean => {
4
+ return regex.test(s)
5
+ }
6
+
7
+ export const escapeJSKey = (s: string): string => {
8
+ if (typeof s !== 'string') {
9
+ return 'string'
10
+ // console.log(s)
11
+ // debugger
12
+ }
13
+ // ❌ probably wrong
14
+ if (!isValidJSKey(s)) {
15
+ // debugger
16
+ return `"${s}"`
17
+ }
18
+ return s
19
+ }
20
+
21
+ export const asJSAccessor = (s: string): string => {
22
+ if (typeof s !== 'string') {
23
+ return 'string'
24
+ // console.log(s)
25
+ // debugger
26
+ }
27
+ if (!isValidJSKey(s)) {
28
+ // debugger
29
+ return `["${s}"]`
30
+ }
31
+ return `.${s}`
32
+ }
@@ -0,0 +1,4 @@
1
+ /* please, keep this file as minimal as possible; it's imported by many apps */
2
+ export function exhaust(x: never): never {
3
+ return x
4
+ }
@@ -0,0 +1,11 @@
1
+ /** Extracts an error message from an exception stuff. */
2
+ export const extractErrorMessage = (error: unknown): string => {
3
+ if (error instanceof Error) return error.message
4
+ if (error === null) return 'null'
5
+ if (typeof error === 'string') return error
6
+ if (typeof error === 'object') {
7
+ if ('message' in error && typeof error.message === 'string') return error.message
8
+ return JSON.stringify(error)
9
+ }
10
+ return String(error)
11
+ }
@@ -0,0 +1,8 @@
1
+ /** case-insensitive subsequence match: 'wide' hits '16:9 (Widescreen)' */
2
+ export function fuzzyMatch(needle: string, hay: string): boolean {
3
+ const n = needle.toLowerCase()
4
+ const h = hay.toLowerCase()
5
+ let i = 0
6
+ for (const ch of h) if (ch === n[i]) i++
7
+ return i >= n.length
8
+ }
@@ -0,0 +1,2 @@
1
+ export const githubRegexpV1 = /https:\/\/github.com\/(.+?)\/(.+?)\/?/
2
+ export const githubRegexpV2 = /https:\/\/github.com\/(.+?)\/([a-zA-Z0-9-_]+)?/
@@ -0,0 +1,6 @@
1
+ import crypto from 'node:crypto'
2
+
3
+ export const hashArrayBuffer = (buffer: /* ArrayBuffer | */ Uint8Array): string => {
4
+ const data = Buffer.from(buffer)
5
+ return crypto.createHash('sha1').update(data).digest('hex')
6
+ }
@@ -0,0 +1,9 @@
1
+ // loud console logging; errors must be observable to human AND LLM.
2
+ // COMFY_TS_QUIET=1 (set by drivers like the TUI) silences INFO chatter only —
3
+ // errors always print.
4
+ export const isQuiet = (): boolean => process.env.COMFY_TS_QUIET === '1'
5
+ export const logInfo = (msg: string): void => {
6
+ if (!isQuiet()) console.log(msg)
7
+ }
8
+ export const logError = (msg: string): void => console.error(`[comfy-ts] 🔴 ${msg}`)
9
+ export const logSuccess = (msg: string): void => console.log(`[comfy-ts] 🟢 ${msg}`)
@@ -0,0 +1,10 @@
1
+ /**
2
+ * build a LoraManager-style lora tag: `<lora:name:strength>` or
3
+ * `<lora:name:strength:clipStrength>`. Pin the name to a host union for
4
+ * autocomplete + validation:
5
+ *
6
+ * loraTag<Comfy.Windows1.Union['E_LoraName']>('myLora', 0.8)
7
+ */
8
+ export function loraTag<N extends string = string>(name: N, strength: number = 1, clipStrength?: number): string {
9
+ return clipStrength == null ? `<lora:${name}:${strength}>` : `<lora:${name}:${strength}:${clipStrength}>`
10
+ }
@@ -0,0 +1,16 @@
1
+ import type { ArkErrors } from 'arktype'
2
+ import { ansi as chalk } from 'src/utils/ansi.ts'
3
+ import { isQuiet } from 'src/utils/log.ts'
4
+
5
+ const MAX_PRINTED_ERRORS = 10
6
+
7
+ export function printArkResultInConsole(res: ArkErrors): void {
8
+ if (isQuiet()) return
9
+ console.log(chalk.red(' ❌ Ark validation failed:'))
10
+ for (const error of res.slice(0, MAX_PRINTED_ERRORS)) {
11
+ console.log(chalk.red(` - ${error.path.join('.')} : ${error.message}`))
12
+ }
13
+ if (res.length > MAX_PRINTED_ERRORS) {
14
+ console.log(chalk.red(` … ${res.length - MAX_PRINTED_ERRORS} more (${res.length} total)`))
15
+ }
16
+ }
@@ -0,0 +1,8 @@
1
+ import { type Type, type } from 'arktype'
2
+ import { printArkResultInConsole } from 'src/utils/printArkResultInConsole.ts'
3
+
4
+ export const softValidate = <T>(schema: Type<T>, stuff: unknown): T => {
5
+ const res = schema(stuff)
6
+ if (res instanceof type.errors) printArkResultInConsole(res)
7
+ return stuff as T
8
+ }
@@ -0,0 +1,32 @@
1
+ const tab = ' '
2
+
3
+ export function readableStringify(obj: unknown, maxLevel = 3, level = 0): string {
4
+ if (level > maxLevel) return JSON.stringify(obj)
5
+ if (typeof obj !== 'object' || obj === null) return JSON.stringify(obj)
6
+ const indent = ' '.repeat(level + 1)
7
+ let result = '{\n'
8
+ const keys = Object.keys(obj)
9
+ for (let i = 0; i < keys.length; i++) {
10
+ // biome-ignore lint/style/noNonNullAssertion: don't care
11
+ const key = keys[i]!
12
+ // biome-ignore lint/suspicious/noExplicitAny: don't care
13
+ const value = (obj as any)[key]
14
+ if (value === undefined) continue
15
+ const valueType = typeof value
16
+
17
+ if (i > 0) result += ','
18
+ const thisIndent = i > 0 ? indent.slice(1) : indent
19
+ if (Array.isArray(value)) {
20
+ result += `${thisIndent}${JSON.stringify(key)}: ${JSON.stringify(value)}`
21
+ } else if (valueType === 'object' && value !== null) {
22
+ result += `${thisIndent}${JSON.stringify(key)}: ${readableStringify(value, maxLevel, level + 1)}`
23
+ } else {
24
+ const formattedValue = valueType === 'string' ? JSON.stringify(value) : value
25
+ result += `${thisIndent}${JSON.stringify(key)}: ${formattedValue}`
26
+ }
27
+ result += '\n'
28
+ }
29
+ result += `${tab.repeat(Math.max(0, level))}}`
30
+
31
+ return result
32
+ }
@@ -0,0 +1,59 @@
1
+ type ObjMap<T> = { [key: string]: T }
2
+
3
+ export type TNode = string
4
+ export type TEdge = [TNode, TNode]
5
+
6
+ export function toposort(nodes: TNode[], edges: TEdge[]): TNode[] {
7
+ return toposortAlgo(nodes, edges)
8
+ }
9
+
10
+ function toposortAlgo(nodes: TNode[], edges: TEdge[]) {
11
+ let cursor = nodes.length
12
+ const sorted = Array.from<TNode>({ length: cursor })
13
+ const visited: ObjMap<boolean> = {}
14
+ let k = cursor
15
+
16
+ while (k--) {
17
+ if (!visited[k]) visit(BONG(nodes[k]), k, [])
18
+ }
19
+
20
+ return sorted
21
+
22
+ function visit(node: TNode, ix: number, predecessors: TNode[]): void {
23
+ let i = ix
24
+ if (predecessors.indexOf(node) >= 0) {
25
+ console.log(predecessors, node)
26
+ throw new Error('Cyclic dependency: ' + JSON.stringify(node))
27
+ }
28
+
29
+ if (nodes.indexOf(node) === -1) {
30
+ throw new Error(
31
+ '[toposort] Found unknown node. Make sure to provided all involved nodes. Unknown node: ' +
32
+ JSON.stringify(node) +
33
+ '; known nodes are ' +
34
+ JSON.stringify(nodes),
35
+ )
36
+ }
37
+
38
+ if (visited[i]) return
39
+ visited[i] = true
40
+
41
+ // outgoing edges
42
+ const outgoing = edges.filter((edge) => edge[0] === node)
43
+ i = outgoing.length
44
+ if (i) {
45
+ const preds = predecessors.concat(node)
46
+ do {
47
+ const child = BONG(outgoing[--i])[1]
48
+ visit(child, nodes.indexOf(child), preds)
49
+ } while (i)
50
+ }
51
+
52
+ sorted[--cursor] = node
53
+ }
54
+ }
55
+
56
+ function BONG<T>(x: T): NonNullable<T> {
57
+ if (x == null) throw new Error('BONG')
58
+ return x
59
+ }
@@ -0,0 +1,41 @@
1
+ import type { Maybe } from 'src/types/index.ts'
2
+
3
+ /** quick utility to verbosely attempt various data recovery tricks */
4
+ export enum RecoveryVerbosity {
5
+ Quiet = 0,
6
+ info = 1,
7
+ Verbose = 2,
8
+ }
9
+
10
+ export function tryRecovering<T>({
11
+ verbose = RecoveryVerbosity.Quiet,
12
+ property,
13
+ hacks,
14
+ onFail,
15
+ onSuccess,
16
+ }: {
17
+ verbose?: RecoveryVerbosity
18
+ property: string
19
+ hacks: {
20
+ level?: RecoveryVerbosity
21
+ attempt: string
22
+ fn: () => Maybe<T>
23
+ }[]
24
+ onFail?: (propName: string) => void
25
+ onSuccess?: (propName: string, value: T) => void
26
+ }): T {
27
+ if (verbose >= RecoveryVerbosity.Verbose) console.log(`[🔶] trying to find a suitable value for ${property}...`)
28
+
29
+ for (const hack of hacks) {
30
+ if (verbose >= RecoveryVerbosity.Verbose) console.log(` > trying to use ${hack.attempt}...`)
31
+ const value = hack.fn()
32
+ if (value != null) {
33
+ if (verbose >= (hack.level ?? RecoveryVerbosity.info))
34
+ if (verbose) console.log(` 🔶 recovered ${property} using ${hack.attempt}.`)
35
+ onSuccess?.(property, value)
36
+ return value
37
+ }
38
+ }
39
+ onFail?.(property)
40
+ throw new Error(`[🔶] ${property} could not be recovered`)
41
+ }
@@ -0,0 +1,16 @@
1
+ import { writeFile } from 'node:fs'
2
+ import { ansi as chalk } from 'src/utils/ansi.ts'
3
+ import { logInfo } from 'src/utils/log.ts'
4
+
5
+ export const writeFileAsync = async (path: string, data: string, fmt: 'utf-8') => {
6
+ return new Promise<void>((resolve, reject) => {
7
+ logInfo(`writing file: ${chalk.blue(path)}`)
8
+ writeFile(path, data, fmt, (err) => {
9
+ if (err) {
10
+ reject(err)
11
+ } else {
12
+ resolve()
13
+ }
14
+ })
15
+ })
16
+ }