transcend-formats
v1.0.4
Published
General formatting helper functions
Downloads
5
Readme
transcend-formats
General formatting helper functions
Source
Source code can be found at js/transcend-formats.js
Installation
npm install transcend-formats
Use
const tf = require('transcend-formats')
// Format Dates
const date = new Date();
console.log(tf.dateFormatter(date));
// Format Duration
const duration = 340230 // in ms
console.log(tf.durationFormatter(duration))
// Format Identity
const input = "test";
console.log(tf.identityFormatter(input))
// Format Image
const img = "/path/to/img.jpg"
console.log(tf.imageFormatter(img))
// Format Image
const row = {
uri : 'https://music-file-location.com'
}
console.log(tf.imageLinkFormatter(img, row, (row) => row.uri))