{"repo":"unjs/knitwork","free":true,"listed":false,"github":"https://github.com/unjs/knitwork","clone":"git clone https://github.com/unjs/knitwork.git","description":"🧶 Utilities to generate safe JavaScript code.","language":"TypeScript","stars":319,"topics":["javascript","typescript","code-generation"],"license":"MIT","category":"dev-tools","readme_excerpt":"🧶 knitwork Utilities to generate JavaScript code. Install ESM (Node.js, Bun, Deno) CommonJS (Legacy Node.js) CDN (Deno and Browsers) ESM genDynamicImport(specifier, options) Generate an ESM dynamic import() statement. genDynamicTypeImport(specifier, name, options) Generate an ESM type import() statement. genExport(specifier, exports?, options) Generate an ESM export statement. genImport(specifier, imports?, options) Generate an ESM import statement. Example: genTypeImport(specifier, imports, options) Generate an ESM import type statement. Serialization genArrayFromRaw(array, indent, options) Serialize an array to a string. Values are not escaped or quoted. Example: genObjectFromRaw(object, indent, options) Serialize an object to a string. Values are not escaped or quoted. Example: genObjectFromRawEntries(array, indent, options) Serialize an array of key-value pairs to a string. Values are not escaped or quoted. genObjectFromValues(obj, indent, options) Serialize an object to a string. Values are escaped and quoted if necessary. Example: String escapeString(id) Escape a string for use in a javascript string. genSafeVariableName(name) Generate a safe javascript variable name. genString(input, options) Generate a string with double or single quotes and handle escapes. Typescript genAugmentation(specifier) Generate typescript declare module augmentation. genInlineTypeImport(specifier, name, options) Generate an typescript typeof import() statement for default import. genInterfac","default_branch":null,"files":null,"tree":[],"storefront":"/r/unjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/unjs/knitwork/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}