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

node-bigset

v1.0.1

Published

High performance Set for handling massive elements. 高性能的集合类,用于处理大量元素的添加和查找。

Downloads

4

Readme

BigSet

一个高性能的集合类,用于处理大量元素的添加、查找和删除操作。

ENGLISH | 中文

特性

  • 支持高效的元素添加和查找
  • 自动维护元素的唯一性
  • 能够处理百万级别的数据
  • 由N-API打造CPP插件而成
  • 目前仅支持字符串
  • CommonJS支持
  • ~整个项目都是AI生成的,我根本看不懂里面写了什么~

安装

使用 npm 安装:

npm install node-bigset

在使用 node-gyp 构建出现错误的情况下,这里提供了预编译的二进制文件。你可以通过以下方式克隆该项目:

git clone https://github.com/ClementLevi/node-BigSet.git 

然后,将该文件夹复制到你的 node_modules 文件夹中。 最后,将预编译的二进制文件解压并安装到 node_modules/node-BigSet/build/Release 中。

使用示例

以下是如何使用 BigSet 的示例:

const { BigSet } = require("node-bigset");

// 创建一个 BigSet 实例
const myBigSet = new BigSet();

// 添加元素
myBigSet.add("Hello");
myBigSet.add("World");

// 暂不支持字符串以外的元素
// 如果您想添加对象等元素,请善用'JSON.stringify()'或'*.toString()'方法将其转换为字符串
myBigSet.add(1); // TypeError: A string was expected


console.log(myBigSet.toString()); // 输出: "Hello, World, "
console.log(myBigSet.getLength()); // 输出: 2
console.log(myBigSet.has("Hello")); // 输出: true
console.log(myBigSet.has("Bye")); // 输出: false

// 删除元素
myBigSet.delete("Hello");
console.log(myBigSet.has("Hello")); // 输出: false
console.log(myBigSet.toString()); // 输出: "World, "

测试

通过 Mocha 运行测试:

npm run test

贡献

欢迎任何形式的贡献!如果您有想法,请创建Issue或提交 Pull Request。

  1. Fork 此仓库
  2. 创建您的特性分支 (git checkout -b feature/YourFeature)
  3. 提交您的更改 (git commit -m 'Add some feature')
  4. 推送到分支 (git push origin feature/YourFeature)
  5. 创建新的 Pull Request

许可

该项目采用 MIT 许可,详情请查看 LICENSE 文件。

免责声明

本项目基于 C++ 插件开发,并在 Node.js 环境中运行。请确保在使用前按照说明正确构建和配置插件。

开发过程中广泛使用了Fitten Code