@yisroel/one-way
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

code generator based on geenee metadata.

Version Downloads/week License

Geenee Template

Why

A geenee template is normally used for multiple generation of code. To do that, geenee-spell stores a meta directory within the generated code base to allow for regeneration.

But geenee templates are a very powerful tool for one-time creation as well. For instance, you may not want to include a meta directory in your code.

What

A single async function that generates code from a specified geenee template and settings.

Usage

Import the package:

npm i one-way

Set the following in your code:

Then you can call:

const generateCode = require('one-way-ticket')

try {
    await generateCode(
      codeDir, nsInfo, config, templateDir
    )
  } catch (error) {
    throw new Error(`could not generate the code: ${error}`)
  }

Example

Check out the usage in geenee-spell.

Creating Templates

You can create such a template easily from a code base using copykat, or just by following the steps for creating templates.

API

async function generateCode(
  codeDir: string,
  nsInfo: NsInfo,
  config: Configuration,
  templateDir: string,
)

The NsInfo and Configuration types are exposed in magicalstrings.

Readme

Keywords

Package Sidebar

Install

npm i @yisroel/one-way

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

88.9 kB

Total Files

78

Last publish

Collaborators

  • yisroel