@fresha/code-morph-ts
v0.3.1
Published
Code parsers and builders for TypeScript
Downloads
13
Keywords
Readme
@fresha/code-morph-ts
This package simplifies programmatic generation and modification of TypeScript
code. It bases itself on ts-morph
, providing additional functionality.
Installation
$ npm install @fresha/code-morph-ts
Usage
addImportDeclaration
,addImportDeclarations
- add one or more import declarations. Prevents duplicate imports.addConstant
,addVariable
- define a constant or a variableaddFunction
- add a function declarationaddObjectLiteralProperty
,addObjectLiteralProperties
,addObjectLiteralObjectProperty
,addObjectLiteralArrayProperty
- add one or more properties to an object literaladdDecorator
- add a decoratoraddTypeAlias
,addTypeLiteralAlias
- add type aliasesaddTypeLiteralProperty
,addFunctionTypeProperty
,addTypeLiteralCall
- add one or more properties to type literals