1.3.0 • Published 4 years ago

adeunis-codecs-mfi3 v1.3.0

Weekly downloads
-
License
-
Repository
github
Last release
4 years ago

Adeunis codecs

TypeScript project for JavaScript/Node.js library of Adeunis codecs.

This document explains how to modify, compile and package the library. For beginners, developments can be done directly on generated JavaScript files (no compilation).

Prerequisites

A Node.js + npm environment is required to start developments:

  • Node.js, JavaScript runtime
  • npm, package manager for JavaScript (shipped with Node.js)

A knowledge of TypeScript language is also recommended.

Getting started

Go to project folder and install dependencies:

npm install

Project structure

bin/                         library entry point
dist/                        compiled .js files and static files
|- demo-page.html            example of how to use the library
|- lib.public.js             library file
src/                         project .ts source code
|- core/                     core module (singleton services)
|- demo/                     basic demo pages that use lib.public.js
|- products/                 products folder
|  |- dc/                    dc module (Dry Contact)
|     |- 0x10.builder.ts     builder file for dc 0x10 frame
|     |- 0x40.parser.spec.ts parser unit tests file for dc 0x40 frame
|     |- 0x40.parser.ts      parser file for dc 0x40 frame
|     +- ...                 additional frame handlers
|  |- pulse/                 pulse module 
|  |- temp/                  temp module 
|  +- ...                    additional products
|- shared/                   shared module
|- decoder.ts                decoder entry point
|- encoder.ts                encoder entry point
+- cli.ts                    CLI entry point

lib.public.js is the generated standalone library file used in demonstration web page.

Main tasks

Task automation is based on NPM scripts.

TasksDescription
npm startBuild library (see npm run build)
npm testRun unit tests once
npm run lintLint code
npm run buildBuild project as single .js file
npm run build:libBuild library as standalone single .js file
npm run build:cliBuild CLI as CommonJS module
npm run build:testBuild tests as CommonJS modules
npm run pack:exePackage codec library into .exe file (Windows x64)
npm run pack:linuxPackage codec library fo linux (Linux x64)
npm run docsDisplay project documentation

Annex

codec CLI

More information here.

Source code generation

To get version from package.json, do global npm run build

Quick test

Basic demo pages are available in generic\src\demo\

1.3.0

4 years ago