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

@sapphirecode/consts

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sapphirecode/consts

useful constant values that are used in many applications

  • 1.2.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-95.83%
Maintainers
1
Weekly downloads
 
Created
Source

@sapphirecode/consts

version: 1.2.x

useful constant values that are used in many applications

Installation

npm:

npm i --save @sapphirecode/consts

yarn:

yarn add @sapphirecode/consts

Usage

there are many constants, too many to document by hand so I suggest you use autocomplete or look into the source.

Http status codes:

const {http} = require('@sapphirecode/consts');

console.log(http.status_ok); // 200

Time

const {time} = require('@sapphirecode/consts');

console.log(time.base_ms.minute); // 60000

The time module contains a few precalculated bases like base_s, base_ms, base_us and base_ns. Those allow you to use timers without calculating everything first.

timer(base_ms.week) instead of timer(1000 x 60 x 60 x 24 x 7) or timer(base_us.week) if your timer counts in microseconds

time intervals above one week are functions, because they require additional information to be calculated

console.log(time.base_ms.year(2020));
console.log(time.base_ms.year(12, 2020));

License

MIT © Timo Hocker timo@scode.ovh

Keywords

FAQs

Package last updated on 15 Jan 2021

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