formule
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Formule

JavaScript implementation of formulas for humans.

Contents

Installing

Using Yarn

yarn add formule

Using NPM

npm install formule

Using UMD

<script src="https://unpkg.com/formule/dist/formule.umd.js"></script>

API

Constants

e

The base of the natural logarithm.

Types

number

Syntax

e

Examples

// 2.718281828459045

pi

The ratio of a circle's circumference to its diameter.

Types

number

Syntax

pi

Examples

pi // 3.141592653589793

Functions

concat

Concatenates its arguments and returns the result.

Types

Input: any
Output: string

Syntax

concat(...text)

Examples

concat('Hello', 'World') // HelloWorld

join

Inserts the first argument between the rest and returns their concatenation.

Types

Input: any
Output: string

Syntax

join(...text)

Examples

join('-', 1, 2, 3) // 1-2-3

now

Returns the current date and time.

Types

string

Syntax

now()

Examples

now() // Nov 6, 1999

toNumber

Parses a number from string, boolean or date.

Types

Input: string boolean number Date
Output: number

Syntax

toNumber(text)

Examples

toNumber(false) // 0

License

MIT


elaurent.org  ·  GitHub emersonlaurentino  ·  Twitter @elaurent_

Readme

Keywords

none

Package Sidebar

Install

npm i formule

Weekly Downloads

1

Version

0.3.0

License

MIT

Unpacked Size

289 kB

Total Files

20

Last publish

Collaborators

  • emersonlaurentino