@scalenc/tmt-format
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

tmt-format

License NPM version

This is a typescript library to read the TRUMPF TMT file format.

It comes with a plain class model of the TMT file and a persistency layer to read and write this model from a string.

Installation

npm install @scalenc/tmt-format
yarn add @scalenc/tmt-format
pnpm add @scalenc/tmt-format

Examples

Sample usage to read TRUMPF TMT file

import fs from 'fs';
import { Reader, Writer } from '@scalenc/tmt-format';

// Read TMT example
const tmt = fs.readFileSync('input.tmt', 'latin1');
const reader = new Reader(tmt, []).read();

const { header, domains } = reader;
if (!header || !domains) throw new Error('Expected header and domains');

// Write TMT example
const written = Writer.write(header, domains);
fs.writeFileSync('output.tmt', written, { encoding: 'latin1' });

Development

Run yarn to setup project and install all dependencies.

Run yarn test to run all tests.

Run yarn lint to check for linting issues.

Run yarn build to build.

License

All rights reserved to ScaleNC GmbH.

Source Code and Binaries licensed under BSD-3-Clause.

Readme

Keywords

Package Sidebar

Install

npm i @scalenc/tmt-format

Weekly Downloads

1

Version

1.2.3

License

BSD-3-Clause

Unpacked Size

42.7 kB

Total Files

47

Last publish

Collaborators

  • daniel.scalenc
  • stephan.scalenc