@stacksavings/utils
v1.1.4
Published
Utility module
Downloads
3
Keywords
Readme
Stacksavings - Utils
Hemos creado un paquete "@stacksavings/utils" para dar métodos que faciliten la programación dentro de jsTrader como logs, conversiones de fecha etc.
Table of contents
Getting Started
Installing
Para poder instalar el cliente solo basta con ejecutar el comando:
npm i @stacksavings/utils
Usage
Para empezar a usarlo solo debe de incluirlo en tu código asi:
const dynamoDB = require('@stacksavings/utils')
Methods
- log:
const logger = require('@stacksavings/utils').log()
logger.info('This is a informative log')
logger.error('This is a error log')
Output:
{"level":"info","message":"This is a informative log","timestamp":"19:38:48"}
{"level":"error","message":"This is a error log","timestamp":"19:38:48"}
- toTimeStampUnix:
const logger = require('@stacksavings/utils').log()
const TimeStamp = require('@stacksavings/utils')
logger.info(TimeStamp.toTimeStampUnix(20180115))
Output:
1515990600
- todayTimeStampUnix:
const logger = require('@stacksavings/utils').log()
const TimeStampToday = require('@stacksavings/utils')
logger.info(TimeStamp.todayTimeStampUnix())
Output:
1544328000 //date 2018/1/29
Test
$ npm run test
Creators
Stacksavings
- https://site.stacksavings.com
David Molina
- https://dmolina101.github.io
Hendrix Roa
- Hendrix Roa