
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
FKit (pronounced eff-kit) is a functional programming toolkit for JavaScript. It provides many functions for solving common problems with functions, objects, arrays, and strings. It aims to provide reusable building blocks while maintaining a laser focus on everyday utility.
Features:
Why reinvent the wheel? FKit provides many functions for solving everyday problems to do with functions, arrays, objects, and strings.
FKit treats both strings and arrays as lists, which means you can apply the
same list functions to both strings and arrays (e.g. head
, tail
, map
,
filter
, fold
, etc).
Most FKit functions are already curried by default, so you can partially apply them wherever you need to.
The ordering of arguments to FKit functions is carefully designed to be more natural, this makes them highly composable.
It's very compact, roughly 3 KB when minified and gzipped!
Install the npm package:
> npm install fkit
Import just the functions you need:
import { add } from 'fkit'
console.log(add(1, 2))
Or import the whole library:
import * as F from 'fkit'
console.log(F.add(1, 2))
The easiest way to start using FKit in your browser is to include it with a
<script>
tag in your HTML file:
<script src="https://unpkg.com/fkit/dist/fkit.min.js"></script>
Presentation by Josh Bassett: Everyday Functional Programming in JavaScript
Article by Josh Bassett: Take Your Code to the Next Level with FKit
Sum the numbers in a list:
import { sum } from 'fkit'
sum([1, 2, 3]) // 6
Stash a string:
import { map, surround } from 'fkit'
map(surround('{', '}'), 'hello') // '{h}{e}{l}{l}{o}'
Intersperse the numbers in a list with another number:
import { intersperse } from 'fkit'
intersperse(4, [1, 2, 3]) // [1, 4, 2, 4, 3]
Filter the numbers in a list where 1 <= n <= 5:
import { between } from 'fkit'
[1, 2, 3, 4, 5].filter(between(2, 4)) // [2, 3, 4]
Calculate the Cartesian product of two lists:
import { cartesian } from 'fkit'
cartesian([1, 2], [3, 4]) // [[1, 3], [1, 4], [2, 3], [2, 4]]
Calculate the permutations of a list:
import { permutations } from 'fkit'
permutations('abc') // ['abc', 'bac', 'cba', 'bca', 'cab', 'acb']
Check out some more examples:
FKit is licensed under the MIT licence. See the LICENCE file for more details.
3.4.1 (2021-03-25)
FAQs
A functional programming toolkit for JavaScript.
The npm package fkit receives a total of 346 weekly downloads. As such, fkit popularity was classified as not popular.
We found that fkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.