# simdle-native

> libsimdle JavaScript bindings for Node.js

Latest version **1.3.9** (published 2025-11-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install simdle-native
pnpm add simdle-native
yarn add simdle-native
bun add simdle-native
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.3.9 |
| Published | 2025-11-10 |
| First published | 2022-09-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Holepunch |
| Maintainers | mafintosh, kasperisager |

## Links

- npm: https://www.npmjs.com/package/simdle-native
- Repository: https://github.com/holepunchto/simdle-native
- Homepage: https://github.com/holepunchto/simdle-native#readme
- Issues: https://github.com/holepunchto/simdle-native/issues
- npm.io page: https://npm.io/package/simdle-native

## Dependencies (2)

- [b4a](https://npm.io/package/b4a.md) ^1.6.0
- [require-addon](https://npm.io/package/require-addon.md) ^1.1.0

## Recent versions

- 1.3.9 (latest) — 2025-11-10
- 1.3.8 — 2025-11-07
- 1.3.7 — 2025-08-21
- 1.3.6 — 2025-02-20
- 1.3.5 — 2025-02-11
- 1.3.4 — 2024-11-13
- 1.3.3 — 2024-10-22
- 1.3.2 — 2024-10-01
- 1.3.1 — 2024-09-13
- 1.3.0 — 2024-09-12
- 1.2.6 — 2024-02-20
- 1.2.5 — 2024-02-16
- 1.2.4 — 2024-02-09
- 1.2.3 — 2024-02-09
- 1.2.2 — 2024-02-07
- … 10 more at https://npm.io/package/simdle-native/versions

## README

# simdle-native

https://github.com/holepunchto/libsimdle JavaScript bindings for Node.js.

```sh
npm install simdle-native
```

## Usage

```js
const { cnt } = require('simdle-native')

cnt(Buffer.alloc(16, 0xff))
// <Buffer 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08>
```

## API

The lane width of all APIs is determined by the input buffer. That is, if providing a `Uint8Array` the lane width will be 8 bits, if providing a `Uint16Array` the lane width will be 16 bits and so on.

#### `const result = allo(buffer)`

Check if the buffer contains only ones.

#### `const result = allz(buffer)`

Check if the buffer contains only zeros.

#### `const result = and(a, b[, result])`

Compute the bitwise AND of `a` and `b`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = clear(a, b[, result])`

Clear the bits in `b` from `a`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = clo(buffer[, result])`

Count the number of leading ones in `buffer`, storing the result in `result`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = clz(buffer[, result])`

Count the number of leading zeroes in `buffer`, storing the result in `result`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = cnt(buffer[, result])`

Compute the population count in `buffer`, storing the result in `result`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = cto(buffer[, result])`

Count the number of trailing ones in `buffer`, storing the result in `result`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = ctz(buffer[, result])`

Count the number of trailing zeroes in `buffer`, storing the result in `result`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = not(buffer[, result])`

Compute the bitwise NOT in `buffer`, storing the result in `result`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = or(a, b[, result])`

Compute the bitwise OR of `a` and `b`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

#### `const result = sum(buffer)`

Compute the sum of `buffer` as a `bigint`.

#### `const result = xor(a, b[, result])`

Compute the bitwise XOR of `a` and `b`. If `result` is not provided, a fresh buffer is allocated. The `result` buffer is returned to the caller.

## License

Apache-2.0

---
_Source: https://npm.io/package/simdle-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
