Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@bitty/pipe
Advanced tools
A pipe function to perform function composition in LTR (Left To Right) direction.
@bitty/pipe
A pipe function to perform function composition in LTR (Left-To-Right) direction.
📦 Distributions in ESM, CommonJS, UMD and UMD minified formats.
⚡ Lightweight:
ramda.pipe
.🔋 Bateries included:
🏷 Safe:
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install @bitty/pipe --save
# For Yarn, use the command below.
yarn add @bitty/pipe
This module has a UMD bundle available through JSDelivr and Unpkg CDNs.
<!-- For UNPKG use the code below. -->
<script src="https://unpkg.com/@bitty/pipe"></script>
<!-- For JSDelivr use the code below. -->
<script src="https://cdn.jsdelivr.net/npm/@bitty/pipe"></script>
<script>
// UMD module is exposed through the "pipe" global function.
console.log(pipe);
//=> "[Function: pipe]"
</script>
Import pipe
from package and just compose your functions with it.
import pipe from '@bitty/pipe';
const resolveToNumber = pipe(
(value: unknown) => typeof value === 'number' ? value : parseFloat(value),
(value: number) => Number.isNaN(value) ? 0 : value,
);
resolveToNumber('12389');
//=> 12389
The first pipe argument is an arity N function, so you can receive more than one argument in the composition.
import pipe from '@bitty/pipe';
const fromTextToWords = (text: string, wordsToIgnore: string[] = []) =>
text
.trim()
.split(/\s+/)
.filter((word) => !wordsToIgnore.includes(word));
const formatToInitials = pipe(
fromTextToWords,
(words) => words.map((word) => word.charAt(0)),
(initials) => initials.join('').toUpperCase(),
);
formatToInitials('abraão william de santana ', ['de']);
//=> "AWS"
Released under MIT License.
FAQs
A pipe function to perform function composition in LTR (Left To Right) direction.
The npm package @bitty/pipe receives a total of 5,124 weekly downloads. As such, @bitty/pipe popularity was classified as popular.
We found that @bitty/pipe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.