# @labjack/ljmmm-parse

> Library for parsing LabJack Modbus Map Markup documents.

Latest version **0.4.0** (published 2020-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @labjack/ljmmm-parse
pnpm add @labjack/ljmmm-parse
yarn add @labjack/ljmmm-parse
bun add @labjack/ljmmm-parse
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2020-07-17 |
| First published | 2020-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 21 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Sam Pottinger |
| Maintainers | sjarman, david_lj, rolsen |
| Keywords | LabJack, LJMMM, MODBUS |

## Links

- npm: https://www.npmjs.com/package/@labjack/ljmmm-parse
- Repository: https://github.com/labjack/labjack_kipling
- Homepage: https://github.com/labjack/labjack_kipling/tree/master/@labjack/ljmmm-parse
- Issues: https://github.com/labjack/labjack_kipling/issues
- npm.io page: https://npm.io/package/@labjack/ljmmm-parse

## Dependencies (2)

- [async](https://npm.io/package/async.md) 1.5.2
- [sprintf-js](https://npm.io/package/sprintf-js.md) 1.1.2

## Recent versions

- 0.4.0 (latest) — 2020-07-17

## README

ljmmm-parse
===========
[LabJack Modbus Map Markup](https://bitbucket.org/labjack/ljm_constants) language parser micro-library for Node.js.  
  

Installation
--------------
``npm install ljmmm-parse``
  

Usage
---------
```javascript
var ljmmm_parse = require('@labjack/ljmmm-parse');

/**
 * Logs
 * [
 *     {name: 'Test0', address: 0, type: 'UINT32'},
 *     {name: 'Test1', address: 2, type: 'UNIT32'},
 *     {name: 'Another0', address: 0, type: 'UINT32'},
 *     {name: 'Another1', address: 2, type: 'UNIT32'}
 * ]
**/
ljmmm_parse.expandLJMMMEntries(
    [
        {name: 'Test#(0:1)', address: 0, type: 'UINT32'},
        {name: 'Another#(0:1)', address: 0, type: 'UINT32'}
    ]
    function (err) { console.log(err); },
    function (expandedEntries) { console.log(expandedEntries); }
);

/**
 * Logs
 * [
 *     {name: 'Test0', address: 0, type: 'UINT32'},
 *     {name: 'Test1', address: 2, type: 'UNIT32'}
 * ]
**/
ljmmm_parse.expandLJMMMEntry(
    {name: 'Test#(0:1)', address: 0, type: 'UINT32'},
    function (err) { console.log(err); },
    function (expandedEntries) { console.log(expandedEntries); }
);

// Logs ['Test0', 'Test1', 'Test2']
ljmmm_parse.expandLJMMMName(
    'Test#(0:2)',
    function (err) { console.log(err); },
    function (expandedNames) { console.log(expandedNames); }
);

/**
 * Also available:
 * 
 * ljmmm_parse.expandLJMMMEntriesSync(listOfEntries);
 * ljmmm_parse.expandLJMMMEntrySync(entry);
**/
```


License and Copyright
-----------------------------
LabJack Corp, 2013  
Sam Pottinger, 2013

Released under the [MIT license](http://opensource.org/licenses/MIT).


Background and motivation
-----------------------------------
To standardize MODBUS map specification, LabJack developed LJMMM or LabJack Modbus Map Markup (see [ljm_constants](https://bitbucket.org/labjack/ljm_constants)). To support software targeting LabJack devices written in Node, this library supports the interpretation of LJMMM fields.


Testing
---------
Requires [rewire](https://github.com/jhnns/rewire) (npm install rewire) and [nodeunit](https://github.com/caolan/nodeunit) (npm install nodeunit).
```
nodeunit ljmmm_test.js
```


Development environment and standards
-----------------------------------------------------
This project maintains 80% code coverage at minimum and conforms to both [jsDoc](http://usejsdoc.org/) and [Google JavaScript style guidelines](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml).

---
_Source: https://npm.io/package/@labjack/ljmmm-parse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
