Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 381 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 381 Bytes

convert-iso8601-duration

Convert YouTube like duration strings to seconds

Install

npm i -S convert-iso8601-duration

Example

const isoConvert = require('convert-iso8601-duration');
const seconds = isoConvert('PT1M37S')
console.log('seconds', seconds); // 'seconds', 97
console.log('ms', (seconds * 1000)); // 97000

Test

npm test

Build

npm run build