Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

filter-limit

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filter-limit

JavaScript library designed for efficiently filtering arrays while limiting the number of results. Ideal for handling large datasets.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by20%
Maintainers
1
Weekly downloads
 
Created
Source

filter-limit

Tests License: MIT

Overview

filter-limit is a lightweight JavaScript library that provides a convenient method for filtering arrays while limiting the number of results. This is particularly useful for efficiently handling large datasets when you are interested in only a subset of elements.

Features

  • 🚀 Performance-focused
  • 🔎 Filters arrays based on custom criteria
  • 🚧 Limit the number of results
  • 🕊️ Dependency-free
  • 🛠️ Works with CJS and ESM
  • 🪶 Lightweight
    • ESM 226B (201B gzipped)
    • CJS 302B (254B gzipped)

Installation

You can install the library via npm:

npm install filter-limit

Or import ESM module from CDN

import filterLimit from 'https://unpkg.com/filter-limit/dist/esm/index.min.js';

Usage

import filterLimit from 'filter-limit';

const input = [1, 2, '3', 4, '5', 6, '7', '8', 9];

const result = filterLimit(input, 3, (value) => typeof value === 'number');

console.log(result); // [1, 2, 4]

License

MIT

Keywords

FAQs

Package last updated on 08 Jan 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc