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

convert

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert

[![bundlephobia](https://bundlephobia.com/api/stats-image?name=convert&version=0.5.0-canary&wide=true)](https://bundlephobia.com/result?p=convert)

  • 0.5.0-canary
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
46K
increased by7.05%
Maintainers
1
Weekly downloads
 
Created
Source

Convert

bundlephobia

A small library for really easy, totally type-safe unit conversions in JavaScript & TypeScript.

It's not ready for production release, but all the groundwork for adding in new conversions is done.

yarn add convert
# or
npm install convert

Features

  • Full build time and runtime checks of conversions
  • Treeshake-able builds available
  • 0 dependencies
  • Out of the box ES5 backwards-compatibility
  • Works in browsers and Node.js

Usage

import {convert} from 'convert';

// 360 seconds into minutes
convert(360)
	.from('seconds')
	.to('minutes'); // 6

Contributing

Below is a list of commands you will probably find useful.

yarn start

Runs the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab.

Your library will be rebuilt if you make edits.

yarn build

Bundles the package to the dist folder. The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).

yarn test

Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.

Thanks

Big thanks to @Jdender, @TheAkio, @iCrawl, @p7g, @aequasi, and the TypeScript Discord server for their help in getting the typesafety working.

FAQs

Package last updated on 13 Jun 2020

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