@scale-codec/namespace-codegen
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@scale-codec/namespace-codegen

Automatization tool for @scale-codec/namespace definition code generation.

Usage

import { generate } from '@scale-codec/namespace-codegen';
import def from './def';
import fs from 'fs/promises';
import path from 'path';

(async function () {
    const code = generate(def, {
        namespaceTypeName: 'Namespace',
        namespaceValueName: 'types',
        importLib: '@scale-codec/namespace',
    });

    await fs.writeFile(path.join(__dirname, 'ns.ts'), code);
})().catch((err) => {
    console.error('Generation failed', err);
    process.exit(1);
});

Readme

Keywords

none

Package Sidebar

Install

npm i @scale-codec/namespace-codegen

Weekly Downloads

1

Version

0.1.0

License

Apache-2.0

Unpacked Size

33.4 kB

Total Files

6

Last publish

Collaborators

  • soramitsu-admin