https://github.com/romainmuller/programming-linguist
A library to facilitate generation of TypeScript code from TypeScript/Javascript applications.
https://github.com/romainmuller/programming-linguist
code-generation constructs node typescript
Last synced: about 1 year ago
JSON representation
A library to facilitate generation of TypeScript code from TypeScript/Javascript applications.
- Host: GitHub
- URL: https://github.com/romainmuller/programming-linguist
- Owner: RomainMuller
- License: apache-2.0
- Created: 2020-07-08T18:03:02.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-25T06:04:42.000Z (about 3 years ago)
- Last Synced: 2024-05-02T04:10:28.108Z (almost 2 years ago)
- Topics: code-generation, constructs, node, typescript
- Language: TypeScript
- Homepage:
- Size: 481 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# `programming-linguist`



A library to facilitate generation of TypeScript code from TypeScript/Javascript
applications.
## Quick Start
### Installation
Add the library to your dependencies using your package manager of choice:
- `npm install programming-linguist`
- `yarn add programming-linguist`
### Usage
Start by creating a new `Project`, then add `SourceFile`s to it with statements
in those, and finally synthesize the `Project`:
```ts
import * as linguist from 'programming-linguist';
// Creating a root TypeScript Project
const project = new linguist.Project();
// Creating a new SourceFile in the project
const sourceFile = new linguist.SourceFile(project, 'index');
// Adding a new Interface declaration
new linguist.Interface(sourceFile, 'FooInterface', {
documentation: 'This is an example interface',
exported: true,
name: 'FooInterface',
});
// Synthesizing the project into `/target/directory`:
project.synthesize('/target/directory');
```