UNPKG

@ipfn/ts-neuron-gen

Version:

[![IPFN project](https://img.shields.io/badge/project-IPFN-blue.svg?style=flat-square)](http://github.com/ipfn) [![npm](https://img.shields.io/npm/v/@ipfn/ts-neuron-gen.svg?maxAge=86400&style=flat-square)](https://www.npmjs.com/package/@ipfn/ts-neuron-gen

41 lines (24 loc) 1.59 kB
# ts-neuron-gen – <sub><sup>IPFN Neurons definitions from TypeScript</sub></sup> [![IPFN project](https://img.shields.io/badge/project-IPFN-blue.svg?style=flat-square)](http://github.com/ipfn) [![npm](https://img.shields.io/npm/v/@ipfn/ts-neuron-gen.svg?maxAge=86400&style=flat-square)](https://www.npmjs.com/package/@ipfn/ts-neuron-gen) [![Dependency Status](https://david-dm.org/ipfn/ts-neuron-gen.svg?style=flat-square)](https://david-dm.org/ipfn/ts-neuron-gen) [![Dev Dependency Status](https://david-dm.org/ipfn/ts-neuron-gen/dev-status.svg?style=flat-square)](https://david-dm.org/ipfn/ts-neuron-gen?type=dev) [![Circle CI](https://img.shields.io/circleci/project/ipfn/ts-neuron-gen.svg)](https://circleci.com/gh/ipfn/ts-neuron-gen) This package provides `ts-neuron-gen` command line tool that generates **neurons** definitions from **TypeScript** source code. ## Install This project is available through npm. To install run: ```console $ npm install -g @ipfn/ts-neuron-gen ``` ## Usage It generates `neurons.json` and `neurons.pb` descriptor files from command line or using JavaScript API. ## Usage in CLI In a TypeScript project with a `package.json` and a `tsconfig.json` run: ```console $ ts-neuron-gen ``` It will generate `neurons.json` file containing definitions of neurons for all exported `functions` and `classes` in the project. ## Usage in JavaScript Take a look at [bin/ts-neuron-gen.ts](bin/ts-neuron-gen.ts) code to see example usage. ## Project This source code is part of [IPFN](https://github.com/ipfn) – interplanetary functions project.