Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-duration

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-duration - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

History.md

6

index.js

@@ -0,1 +1,2 @@

'use strict'

@@ -13,3 +14,3 @@ var duration = /(-?\d*\.?\d+(?:e[-+]?\d+)?)\s*([a-zμ]*)/ig

parse.μs =
parse['μs'] =
parse.microsecond = 1 / 1e3

@@ -39,2 +40,3 @@

parse.b =
parse.month = parse.d * (365.25 / 12)

@@ -55,2 +57,4 @@

var result = 0
// ignore commas
str = str.replace(/(\d),(\d)/g, '$1$2')
str.replace(duration, function(_, n, units){

@@ -57,0 +61,0 @@ units = parse[units]

18

package.json
{
"name": "parse-duration",
"version": "0.1.1",
"version": "0.1.2",
"description": "convert a human readable duration string to ms",
"keywords": ["parse","duration","time"],
"keywords": [
"parse",
"duration",
"time"
],
"dependencies": {},
"devDependencies": {
"serve": "jkroso/serve",
"jsmd": "*"
"tape": "^4.8.0"
},
"scripts": {
"test": "node test"
},
"repository": "git://github.com/jkroso/parse-duration.git",
"bugs": "https://github.com/jkroso/parse-duration/issues",
"author": "Jake Rosoman",
"files": ["index.js"],
"files": [
"index.js"
],
"license": "MIT"
}
# parse-duration
# parse-duration ![travis](https://travis-ci.org/jkroso/parse-duration.svg?branch=master)

@@ -8,8 +8,4 @@ convert a human readable duration to ms

With your favourite package manager:
`npm install parse-duration`
- [packin](//github.com/jkroso/packin): `packin add parse-duration`
- [component](//github.com/component/component#installing-packages): `component install jkroso/parse-duration`
- [npm](//npmjs.org/doc/cli/npm-install.html): `npm install parse-duration`
then in your app:

@@ -51,2 +47,8 @@

comma seperated numbers
```js
parse('27,681 ns') // => 27681 * ns
```
And most other types of noise

@@ -53,0 +55,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc