Socket
Book a DemoInstallSign in
Socket

casette

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

casette

A tiny modular converter library

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

casette

Casette is a tiny modular converter library. It's ridiculously simple, yet effective.

Installation

npm i casette

Example

const casette = require('casette')

// Built-in converters
var inch = 2
console.log(casette(inch, 'inch-cm'))

console.log(casette(-2, 'celsius-fahrenheit'))

// External converters
var some = casette(14, require('./some-converter'))

// Internal converters
var res = casette(25, a => a * 2 / 5)

Usage

You can use built-in, external or internal converters, that are simple, exported functions. Take a look at the built-in ones in the converters directory.

If you have an idea for a converter build it and PR, please. If required, write its test in the converters/converters.test.js. Tests are cool!

API

casette(value, converter)

Takes the value and the converter arguments. value can be anything, converter must be function. Returns anything.

Keywords

converter

FAQs

Package last updated on 16 Jan 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.