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

timestring

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timestring

Parse a human readable time string into a time based value

  • 7.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
194K
decreased by-2.14%
Maintainers
1
Weekly downloads
 
Created

What is timestring?

The timestring npm package is a utility for parsing human-readable time strings into milliseconds. It allows users to convert strings like '2 days', '3 hours', or '5 minutes' into a numerical representation of time in milliseconds, which can be useful for scheduling, time calculations, and more.

What are timestring's main functionalities?

Parse time strings to milliseconds

This feature allows you to convert a human-readable time string into milliseconds. For example, '2 days' is converted to 172800000 milliseconds.

const timestring = require('timestring');
const milliseconds = timestring('2 days'); // returns 172800000

Support for various time units

The package supports parsing of various time units such as seconds, minutes, hours, days, weeks, months, and years. It can handle combinations of these units in a single string.

const timestring = require('timestring');
const milliseconds = timestring('3 hours 15 minutes'); // returns 11700000

Other packages similar to timestring

Keywords

FAQs

Package last updated on 27 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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