New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

english-secs

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

english-secs

![Run Tests](../../actions/workflows/test.yml/badge.svg)

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Run Tests

english-secs

convert english time expressions to seconds or milliseconds. zero runtime dependencies.

install

npm install english-secs --save

usage

const etime = require('english-secs');

console.log(etime('1 hour')); // 3600
console.log(etime('2 days 12 hours')); // 216000
console.log(etime('1 month', {milliseconds: true})); // 2678400000

api

etime(input, options)

  • input: string or number. if number, returns input unchanged.
  • options: object (optional)
    • milliseconds: boolean. if true, returns milliseconds instead of seconds.
    • customUnits: object. custom unit definitions.
    • customSingularUnits: array. custom singular unit names.

features

  • zero runtime dependencies
  • lightweight and fast
  • supports a wide range of time units and formats

development

  • yarn install: install dependencies
  • yarn test: run tests
  • yarn build: compile coffeescript to javascript

license

mit

FAQs

Package last updated on 24 Oct 2024

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