Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including normalplaytime with all npm packages installed. Try it out:

var normalplaytime = require("normalplaytime")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

normalplaytime v1.0.6

Parser for Normal Play Time (RFC 2326)

NormalPlayTime Parser

Parser for Normal Play Time (RFC 2326).

Installation

npm install normalplaytime

Example

var npt = require('normalplaytime');

var ms1 = npt.parse("1");   // return 1000
var ms2 = npt.parse("1.2"); // return 1200

More Specs: (output from npm test)

should return null for invalid strings
should return 1000 for "1"
should return 1234 for "1.234"
should return 754000 for "12:34"
should return 754560 for "12:34.56"
should return 62000 for "1:2"
should return 3723400 for "1:2:3.4"

Development

npm install
npm test

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free