All Projects → sindresorhus → To Milliseconds

sindresorhus / To Milliseconds

Licence: mit
Convert an object of time properties to milliseconds: `{seconds: 2}` → `2000`

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to To Milliseconds

Length.js
📏 JavaScript library for length units conversion.
Stars: ✭ 292 (+114.71%)
Mutual labels:  parser, converter, npm-package
Gelatin
Transform text files to XML, JSON, or YAML
Stars: ✭ 150 (+10.29%)
Mutual labels:  parser, converter
Htmr
Simple and lightweight (< 2kB) HTML string to React element conversion library
Stars: ✭ 214 (+57.35%)
Mutual labels:  parser, converter
Prance
Resolving Swagger/OpenAPI 2.0 and 3.0 Parser
Stars: ✭ 133 (-2.21%)
Mutual labels:  parser, converter
Synp
Convert yarn.lock to package-lock.json and vice versa
Stars: ✭ 510 (+275%)
Mutual labels:  converter, npm-package
Html2pug
Converts HTML to Pug 🐶
Stars: ✭ 118 (-13.24%)
Mutual labels:  parser, converter
Graphql Mst
Convert GraphQL to mobx-state-tree models
Stars: ✭ 22 (-83.82%)
Mutual labels:  parser, converter
Svgurt
Image -> SVG Vectorizing Tool - Live at:
Stars: ✭ 124 (-8.82%)
Mutual labels:  converter, npm-package
Mongolastic
🚥 A dataset migration tool from MongoDB to Elasticsearch and vice versa.
Stars: ✭ 131 (-3.68%)
Mutual labels:  converter
Toml To Go
Translates TOML into a Go type in your browser instantly
Stars: ✭ 134 (-1.47%)
Mutual labels:  converter
Works For Me
Collection of developer toolkits
Stars: ✭ 131 (-3.68%)
Mutual labels:  parser
Go Vimlparser
⚡️ Vim Script Parser written in Go
Stars: ✭ 132 (-2.94%)
Mutual labels:  parser
Ohshitgit
⁉️Oh shit! A cli tool to help you unfuck your git mistakes
Stars: ✭ 135 (-0.74%)
Mutual labels:  npm-package
React Json Schema
Configure and build views using JSON schemas mapped to React components
Stars: ✭ 131 (-3.68%)
Mutual labels:  parser
Ngx Config
Configuration utility for Angular
Stars: ✭ 135 (-0.74%)
Mutual labels:  npm-package
Yjlocationconverter
中国国测局地理坐标(GCJ-02)<火星坐标>、世界标准地理坐标(WGS-84) 、百度地理坐标(BD-09)坐标系转换工具类
Stars: ✭ 131 (-3.68%)
Mutual labels:  converter
Csly
a C# embeddable lexer and parser generator (.Net core)
Stars: ✭ 129 (-5.15%)
Mutual labels:  parser
Handlebars Webpack Plugin
Renders your html-template at build time
Stars: ✭ 135 (-0.74%)
Mutual labels:  npm-package
Harser
Easy way for HTML parsing and building XPath
Stars: ✭ 135 (-0.74%)
Mutual labels:  parser
Net Core Docx Html To Pdf Converter
.NET Core library to create custom reports based on Word docx or HTML documents and convert to PDF
Stars: ✭ 133 (-2.21%)
Mutual labels:  converter

to-milliseconds

Convert an object of time properties to milliseconds: {seconds: 2}2000

Install

$ npm install @sindresorhus/to-milliseconds

Usage

const toMilliseconds = require('@sindresorhus/to-milliseconds');

toMilliseconds({
	days: 15,
	hours: 11,
	minutes: 23,
	seconds: 20,
	milliseconds: 1
});
//=> 1337000001

setTimeout(() => {
	// …
}, toMilliseconds({minutes: 2}));

API

toMilliseconds(input)

input

Type: Object

Specify an object with any of the following properties:

  • days
  • hours
  • minutes
  • seconds
  • milliseconds
  • microseconds
  • nanoseconds

Related

  • parse-ms - The inverse of this module
  • pretty-ms - Convert milliseconds to a human readable string

License

MIT © Sindre Sorhus

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].