@fresha/code-morph-ts
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

@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 variable
  • addFunction - add a function declaration
  • addObjectLiteralProperty, addObjectLiteralProperties, addObjectLiteralObjectProperty, addObjectLiteralArrayProperty - add one or more properties to an object literal
  • addDecorator - add a decorator
  • addTypeAlias, addTypeLiteralAlias - add type aliases
  • addTypeLiteralProperty, addFunctionTypeProperty, addTypeLiteralCall - add one or more properties to type literals

Readme

Keywords

Package Sidebar

Install

npm i @fresha/code-morph-ts

Weekly Downloads

0

Version

0.3.1

License

MIT

Unpacked Size

28.1 kB

Total Files

7

Last publish

Collaborators

  • dziala
  • kondrat-fresha
  • dnaploszek
  • rafal.panasiuk.fresha
  • mykulyak
  • fresha_root
  • wokay_fresha