πŸŽ‰ nanoutils 0.1.0 πŸŽ‰

Alexey Berezin
2 min readJan 14, 2019
Logo is designed by Phil Murphy

What’s nanoutils?

🌊 Tiniest FP-friendly JavaScript utils library

It was created after Lodash and Ramda but the challenge was to have each method less than 1KB.

The basic ideas of nanoutils:

  1. Functional programming is awesome πŸ”₯
  2. No dependencies ❌
  3. No ES6 features ❌
  4. Efficient βš‘πŸš€
  5. Light 🎈

Awesome size πŸ“¦

Size is important as download time depends on it

nanoutils size in comparison with ramda and lodash

nanoutils uses SIZES.md to check its size.

We use library size-limit by Andrey Sitnik. We have custom CLI which can write data to terminal and saves all information to Markdown file.

According to recently added statistics:

  • Average nanoutils method is ~700B lighter than ramda’s
  • 50% of nanoutils methods are less than ~110B while ramda has its median around ~470B
  • maximum method size for nanoutils is within 1KB and equals 674B while ramda doesn’t limit its size and its largest method equals ~3400B

Based on BundlePhobia:

  • nanoutils is tree-shakeable as ramda
  • nanoutils takes 100ms and 500ms less time to be downloaded in comparison with ramda and lodash respectively

Performance

Performance is difficult to compare as time is different for different devices.

nanoutils uses TIMES.md to check its performance time

We use approach with Performance Timing API. We have custom CLI as well with bunch of functions and helpers which combine data and compare it based on several runs. For some methods performance tests (i.e. ap.performance.js) are written where data is cached in JSON files.

Now not all methods are covered with performance tests. It will be done in future releases.

Roadmap

0.1.1 Transducers API introduction
0.2.0
Performance tests coverage
0.3.0 TS coverage

Team

  1. Idea of the project β€” Anton Kosykh
  2. Size compressor of the project β€” Alexey Berezin
  3. Performance accelerator of the project β€” Aleksandr Babkin
  4. Designer of the logo β€” Phil Murphy

Links

  1. Github
  2. Npm
  3. Docs

Thank you!

Alexey Berezin,
Front-end Developer from Yandex

--

--