Skip to main content
Deno 2 is finally here 🎉️
Learn more

logo image

fonction

A modern practical functional library

test GitHub release deno land nest badge deno version node support version bundle size npm download

dependencies Status codecov Codacy Badge npm type definitions Commitizen friendly Gitmoji semantic-release code style: prettier License: MIT


✨ Features

  • 💚 Friendly type definition
  • :earth_americas: Universal functions providing ESM and UMD
  • :package: Optimized, super slim size
  • 📄 TSDoc-style comments
  • 🔢 Bigint support
  • 🦕 Deno support

Fonction (French word for “function”, not typo:sweat_smile:) is modern practical functional library. Special attention is paid to bundle size and strict type definitions. Therefore, you can take out and use only what you want to use without worrying about the size.

📝 Docs

Read the Docs to Learn More.

💚 Supports

The TypeScript version must be 4.1.0 or higher.

This project provide ES modules and UMD. The range supported by both is different.

ES modules

Limit support to the latest environment to reduce the bundle size.

Deno
Deno
Node.js
Node.js
IE / Edge
Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Samsung
Samsung
Opera
Opera
^1.6.0 ^14.16.0 last version last version last version last version last version last version last version

UMD

Browser is supporting since IE11.

Node.js
Node.js
IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Samsung
Samsung
Opera
Opera
^6.17.0 IE11 / ^16 ^60 ^61 ^10.1 ^10.3 ^8.2 ^48

Compared to ES modules, UMD has a bundle size increase of about 2.5x. Recommend using ES modules as much as possible.

💫 Usage

fonction provides multi platform modules.

🦕 Deno

deno.land

import { add } from 'https://deno.land/x/fonction@v1.3.0/mod.ts'

add(1, 2) // 3

nest.land

import { add } from 'https://x.nest.land/fonction@1.3.0/mod.ts'

add(1, 2) // 3

:package: Node.js

Install

npm i fonction
or
yarn add fonction

ESM

import { add } from 'fonction'

add(1, 2) // 3

UMD

const { add } = require('fonction')

add(1, 2) // 3

:globe_with_meridians: CDN

ESM

<script type="module">
  import { add } from 'https://unpkg.com/fonction?module'
  console.log(add(1, 2)) // 3
</script>

UMD

The global object is F.

<script src="https://unpkg.com/fonction"></script>

<script>
  console.log(F.add(1, 2)) // 3
</script>

🗺️ Loadmap

For the time being, my goal is to implement the functions implemented in the great starting projects (lodash, ramda, rambda, … etc).

The release will be a public release when it is fully tested in the beta release and then merged into the main branch.

You can check the implementation status of all functions here.

You can also try all the features including the beta version with the following command or URL.

npm i fonction@beta
or
yarn add fonction@beta
// deno.land
import { _ } from 'https://deno.land/x/fonction@VERSION/mod.ts'

@VERSION format is like v1.5.0-beta.1.

:handshake: Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues.

🌱 Show your support

Give a ⭐️ if this project helped you!

💡 License

Copyright © 2021-present TomokiMiyauci.

Released under the MIT license