Navigation Menu

Skip to content

procedural-build/traec

Repository files navigation

Traec library

This is the traec core library which provide Javascript utilities and bindings for the Track API - which can be used to build supply-chain reporting applications rapidly on top of the Track | Procedural.build services.

Use in a project

To use this library in your application simply do:

npm install --save traec

Then you should be good to go. When you need to make calls to the API for to GET or POST data then you may do it as follows:

import Traec from 'traec'

let fetch = new Traec.Fetch('company', 'list')
fetch.dispatch()

The traec library makes use of an Immutable Redux store. So you should attach a listener to the store to watch for the response data and perform some action when it has returned.

Development

If you are developing the Traec library at the same time as another application then you should use npm link to link the dist folder to your /usr/lib/node_modules folder and then npm link traec into the project you are working on. Like this:

npm run build
cd dist
sudo npm link && rm -rvf node_modules
cd <your-project-folder>
npm link traec

Publishing to npm

From within this root folder run:

rm -rvf dist/*
docker run -it --rm -v "$PWD:/src" node:10.14-slim bash
cd /src/
npm login
npm run matchversion
npm run patchversion
npm run pub

or as a one-line command like this:

rm -rvf dist/* && docker run -it --rm -v "$PWD:/src" node:10.14-slim bash -c "cd /src/ && npm login && npm run matchversion && npm run patchversion && npm run pub"

About

Core Traec library for handling fetch, cache and throttling of data to and from the Track API.

Resources

Stars

Watchers

Forks

Packages

No packages published