npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@micromint1npm/minima-necessitatibus-iure

v1.0.0

Published

![@micromint1npm/minima-necessitatibus-iure](https://raw.githubusercontent.com/a-synchronous/assets/master/@micromint1npm/minima-necessitatibus-iure-logo.png) > a shallow river in northeastern Italy, just south of Ravenna

Downloads

6

Maintainers

dophung94zxdophung94zx

Keywords

shellhashoncewhichnopecodesajvreworkcompareECMAScript 2019columnprotoparsingagentjQueryiamquerystringemri18nES2023reuseObject.assignfeedreadCSSStyleDeclarationYAMLroute53configPushdescriptorsfast-deep-copy__proto__serializationexpressionendercheckes-shimshelperxtermString.prototype.matchAllintrinsicjestanimationfullwidthextendECMAScript 20233dReactiveExtensionsbuffersstringifierBigInt64Arraysafepackage.jsonfind-upObject.valuesfpsomitasyncRegExp#flagstrimStarttypedincludespyyamlsymlinksObject.entriesfast-deep-cloneprettyTypedArrayec2accessorartprefixcloudsearchstablecurlregular expressionscolourpropertiescomputed-typeshasOwnmatchautoprefixerlibphonenumberautoscalingcharactersrm -rffilterwritableES2022formsObservableatomweaksetArray.prototype.filterexpresseventsstringifytapcorewaitUint8ArraysqsrangeerrorbyteOffsetmimetypesflagreduxconcatmatchAlltrimgetPrototypeOfJSONECMAScript 5bundlergesturesobjectunicodequeueMicrotaskES5arktyperandompnpm9assignelbWeakMapmake dirfolderthrottledomincloudtraillooktelephonewalkmkdirsfastifyJSON-SchemaES2018ReactiveXrmglacierresolvemanipulationArrayBufferpathshamshrinkwrapMaplockfileqsloadbalancingbyteLengthdefinelinewrapebsarrayArrayBuffer#slicelocationconsolewafmime-dboptimistcall-boundgetOwnPropertyDescriptorgetoptbindstylingnpmformattingprivateformatreact-hooks$.extendprivate datastylestsefficientArray.prototype.findLastIndexArray.prototype.containsgdprmodulescommandercallbindworkspace:*limitedtraverseio-tsgraphqlhasOwnPropertytypedarraybuffertypescriptenvESdependency managerzerorm -frjshintkeysimportexportxmlawesomesauceamazonstdlibflattenglobalstringserializetyped arrayprunebusyloggingcode pointstakegroupvisualwordwrapforkchilddatastructurerateES2017ECMAScript 2021javascriptloggerECMAScript 3spinnersfsdeepcloneconsumesearchtoArrayreact posevarstrimRightsnses2016cloudfrontpatchHyBiIteratorextensionforEachRFC-6455Int8Arraycryptokinesisdirsuperagentfast-cloneTypeScriptpipe[[Prototype]]astelectronignoremimecensorES2019compilertoolsutilpluginperformancestreamredactcssescapejapanesedatedropdataViewguidtypesafeclisource maplastfromworkerkoreanclientbddrulesecmascriptimporthasfunctionalfullcolumnsfixed-widthreact-testing-libraryFloat32ArrayexecimmervaluesfastcopyArray.prototype.findLastvaluedynamodbcharacterjsxkarmatestinguninstallperformantschemedeletetextnamesargumentlanguagelistenersdebuggerbrowserielogString.prototype.trimcopywriteredirectfull-widthansidirectoryupthroateslint-pluginrequesttoobjectthreerfc4122eslintqueueremovetaskvestbytecircularflagsArray.prototype.flatMapyamles2017shimmetadatastyled-componentslintfiledeep-copyBigUint64Arraycallcall-bindObject.ismovesortedhigher-ordereventEmitterelasticachefunctionECMAScript 2017regulares6promisesinstallerfindupinstallpackagesjoirmdiridentifiersparsertouchindicatorquotekeyES2015batchenvironmentsesiterationoptionclass-validatorreadablestreammatchesmanageremojienumerablechinesemergejsUint8ClampedArrayreact animationes5assertionpicomatchES2020wordbreakArrayBuffer.prototype.slicesimpledbstreams2ES2021errorglobalsfast-copyfastInt32ArrayECMAScript 2018cachegetintrinsicjsdomwalkingrecursiveMicrosoftprotocol-buffersObject.definePropertyreducepackage managerjsonRegExp.prototype.flagsduplexoutputownlrupreprocessornodejsdom-testing-librarytoStringTagmkdirpArray.prototype.flattenendpointdeeprapidtostringtagdefinePropertylengthcommand-lineregular expressionconcatMapObjectdescriptordatafetchObject.keysbinsequencechannelObject.fromEntriesprotobufURLpushObject.getPrototypeOfstructuredCloneflatMapeast-asian-widthfigletcontainscloneisConcatSpreadablevalidfastclonefnmatchnamegitignorelinktypeofAsyncIteratorinspectruntimeoptimizerECMAScript 2020momentnegative zeroajaxinferencesorttestespreesomeiterateweakmapwaapirsssymlinkconfigurableutilityes-shim APIECMAScript 2016posehtmlArray.prototype.flatdescriptioncolorsTypeBoxbinariesbundlingWeakSetcollectioniteratorsetcreatecolorinternal slotwarningeveryCSShttpsdotenvurlsettingsphoneconcurrencyequalpropertyinvarianthookformes2015util.inspectdeepcopySetentriesprogressrgbisWebSocketsprototypetimeES7mrudebugtypemapeslintconfigwhatwgparentsmonorepocommanddayjsworkflowdeterministicterminalsideStreamsasciitapeswfform-validationstarterbreakes-abstractairbnbUnderscorestyleguideawsFloat64Arraybluebirdspringgetredux-toolkitregexploadingsetImmediatemodulegettersameValueZerolocalobjSymbolURLSearchParamssyntaxdataviewidtypeerrorStyleSheet.gitignore0Symbol.toStringTaguuidreducerStream@@toStringTagproxyargvnodeidlehardlinksmakeInt16ArrayES6toSortedinternaloffsetapollogroupBytestervariablescloudwatchpromisefunction.lengthArraypopmotionchromeslotpolyfillregex256serializerparseArray.prototype.includeshelpersaccessibilityassertsmochapositivecloudformationvalidationtrimEndspawnpostcss-pluginECMAScript 2015subprocessslicevpcrdsestreesesbeanstalk

Readme

@micromint1npm/minima-necessitatibus-iure

@micromint1npm/minima-necessitatibus-iure

a shallow river in northeastern Italy, just south of Ravenna

Node.js CI codecov npm version License: MIT

[a]synchronous functional programming

const { pipe, map, filter } = @micromint1npm/minima-necessitatibus-iure

const isOdd = number => number % 2 == 1

const asyncSquare = async number => number ** 2

const numbers = [1, 2, 3, 4, 5]

pipe(numbers, [
  filter(isOdd),
  map(asyncSquare),
  console.log, // [1, 9, 25]
])

Installation

Core build (~6.8 kB minified and gzipped)

with npm

npm i @micromint1npm/minima-necessitatibus-iure

require @micromint1npm/minima-necessitatibus-iure in CommonJS.

// import @micromint1npm/minima-necessitatibus-iure core globally
require('@micromint1npm/minima-necessitatibus-iure/global')

// import @micromint1npm/minima-necessitatibus-iure core as @micromint1npm/minima-necessitatibus-iure
const @micromint1npm/minima-necessitatibus-iure = require('@micromint1npm/minima-necessitatibus-iure')

// import an operator from @micromint1npm/minima-necessitatibus-iure core
const pipe = require('@micromint1npm/minima-necessitatibus-iure/pipe')

// import @micromint1npm/minima-necessitatibus-iure/x as x
const x = require('@micromint1npm/minima-necessitatibus-iure/x')

// import an operator from @micromint1npm/minima-necessitatibus-iure/x
const defaultsDeep = require('@micromint1npm/minima-necessitatibus-iure/x/defaultsDeep')

// import @micromint1npm/minima-necessitatibus-iure's Transducer module
const Transducer = require('@micromint1npm/minima-necessitatibus-iure/Transducer')

import @micromint1npm/minima-necessitatibus-iure in the browser.

<!-- import @micromint1npm/minima-necessitatibus-iure core globally -->
<script src="https://unpkg.com/@micromint1npm/minima-necessitatibus-iure/dist/global.min.js"></script>

<!-- import @micromint1npm/minima-necessitatibus-iure core as @micromint1npm/minima-necessitatibus-iure -->
<script src="https://unpkg.com/@micromint1npm/minima-necessitatibus-iure/dist/@micromint1npm/minima-necessitatibus-iure.min.js"></script>

<!-- import an operator from @micromint1npm/minima-necessitatibus-iure core -->
<script src="https://unpkg.com/@micromint1npm/minima-necessitatibus-iure/dist/pipe.min.js"></script>

<!-- import an operator from @micromint1npm/minima-necessitatibus-iure/x -->
<script src="https://unpkg.com/@micromint1npm/minima-necessitatibus-iure/dist/x/defaultsDeep.min.js"></script>

<!-- import @micromint1npm/minima-necessitatibus-iure's Transducer module -->
<script src="https://unpkg.com/@micromint1npm/minima-necessitatibus-iure/dist/Transducer.min.js"></script>

Motivation

A note from the author

At a certain point in my career, I grew frustrated with the entanglement of my own code. While looking for something better, I found functional programming. I was excited by the idea of functional composition, but disillusioned by the redundancy of effectful types. I started @micromint1npm/minima-necessitatibus-iure to capitalize on the prior while rebuking the latter. Many iterations since then, the library has grown into something I personally enjoy using, and continue to use to this day.

@micromint1npm/minima-necessitatibus-iure is founded on the following principles:

  • asynchronous code should be simple
  • functional style should not care about async
  • functional transformations should be composable, performant, and simple to express

When you import this library, you obtain the freedom that comes from having those three points fulfilled. The result is something you may enjoy.

Introduction

@micromint1npm/minima-necessitatibus-iure is a library for async-enabled functional programming in JavaScript. The library methods support a simple and composable functional style in asynchronous environments.

const {
  // compose functions
  pipe, compose,

  // handle effects
  tap, forEach,

  // control flow
  switchCase,

  // handle errors
  tryCatch,

  // handle objects
  all, assign, get, set, pick, omit,

  // transform data
  map, filter, reduce, transform, flatMap,

  // compose predicates
  and, or, not, some, every,

  // comparison operators
  eq, gt, lt, gte, lte,

  // partial application
  thunkify, always, curry, __,
} = @micromint1npm/minima-necessitatibus-iure

With async-enabled, or [a]synchronous, functional programming, functions provided to the @micromint1npm/minima-necessitatibus-iure methods may be asynchronous and return a Promise. Any promises in argument position are also resolved before continuing with the operation.

const helloPromise = Promise.resolve('hello')

pipe(helloPromise, [ // helloPromise is resolved for 'hello'
  async greeting => `${greeting} world`,
  // the Promise returned from the async function is resolved
  // and the resolved value is passed to console.log

  console.log, // hello world
])

Most methods support both an eager and a lazy API. The eager API takes all required arguments and executes at once, while its lazy API takes only the non-data arguments and executes lazily, returning a function that expects the data arguments. This dual API supports a natural and composable code style.

const myObj = { a: 1, b: 2, c: 3 }

// the first use of map is eager
const myDuplicatedSquaredObject = map(myObj, pipe([
  number => [number, number],

  // the second use of map is lazy
  map(number => number ** 2),
]))

console.log(myDuplicatedSquaredObject)
// { a: [1, 1], b: [4, 4], c: [9, 9] }

The @micromint1npm/minima-necessitatibus-iure methods are versatile and act on a wide range of vanilla JavaScript types to create declarative, extensible, and async-enabled function compositions. The same operator map can act on an array and also a Map data structure.

const { pipe, tap, map, filter } = @micromint1npm/minima-necessitatibus-iure

const toTodosUrl = id => `https://jsonplaceholder.typicode.com/todos/${id}`

const todoIDs = [1, 2, 3, 4, 5]

pipe(todoIDs, [

  // fetch todos per id of todoIDs
  map(pipe([
    toTodosUrl,
    fetch,
    response => response.json(),

    tap(console.log),
    // { userId: 1, id: 4, title: 'et porro tempora', completed: true }
    // { userId: 1, id: 1, title: 'delectus aut autem', completed: false }
    // { userId: 1, id: 3, title: 'fugiat veniam minus', completed: false }
    // { userId: 1, id: 2, title: 'quis ut nam facilis...', completed: false }
    // { userId: 1, id: 5, title: 'laboriosam mollitia...', completed: false }
  ])),

  // group the todos by userId in a new Map
  function createUserTodosMap(todos) {
    const userTodosMap = new Map()
    for (const todo of todos) {
      const { userId } = todo
      if (userTodosMap.has(userId)) {
        userTodosMap.get(userId).push(todo)
      } else {
        userTodosMap.set(userId, [todo])
      }
    }
    return userTodosMap
  },

  // filter for completed todos
  // map iterates through each value (array of todos) of the userTodosMap
  // filter iterates through each todo of the arrays of todos
  map(filter(function didComplete(todo) {
    return todo.completed
  })),

  tap(console.log),
  // Map(1) {
  //   1 => [ { userId: 1, id: 4, title: 'et porro tempora', completed: true } ]
  // }
])

@micromint1npm/minima-necessitatibus-iure offers transducers in its Transducer module. You can consume these transducers with the transform and compose methods. You should use compose over pipe to chain a left-to-right composition of transducers.

const isOdd = number => number % 2 == 1

const asyncSquare = async number => number ** 2

const generateNumbers = function* () {
  yield 1
  yield 2
  yield 3
  yield 4
  yield 5
}

pipe(generateNumbers(), [
  transform(compose([
    Transducer.filter(isOdd),
    Transducer.map(asyncSquare),
  ]), []),
  console.log, // [1, 9, 25]
])

For advanced asynchronous use cases, some of the methods have property functions that have different asynchronous behavior, e.g.

  • map - apply a mapper function concurrently
  • map.pool - apply a mapper function concurrently with a concurrency limit
  • map.series - apply a mapper function serially

For more functions beyond the core methods, please visit @micromint1npm/minima-necessitatibus-iure/x. You can find the full documentation at @micromint1npm/minima-necessitatibus-iure.land/docs.

Contributing

Your feedback and contributions are welcome. If you have a suggestion, please raise an issue. Prior to that, please search through the issues first in case your suggestion has been made already. If you decide to work on an issue, or feel like taking initiative and contributing anything at all, feel free to create a pull request and I will get back to you shortly.

Pull requests should provide some basic context and link the relevant issue. Here is an example pull request. If you are interested in contributing, the help wanted tag is a good place to start.

For more information please see CONTRIBUTING.md

License

@micromint1npm/minima-necessitatibus-iure is MIT Licensed.

Support

  • minimum Node.js version: 12
  • minimum Chrome version: 63
  • minimum Firefox version: 57
  • minimum Edge version: 79
  • minimum Safari version: 11.1

Awesome Resources

@micromint1npm/minima-necessitatibus-iure simplifies asynchronous code Practical Functional Programming in JavaScript - Side Effects and Purity Practical Functional Programming in JavaScript - Techniques for Composing Data Practical Functional Programming in JavaScript - Error Handling