Package Exports
- transcend-formats
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (transcend-formats) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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))