Skip to content

Commit 36c3ac5

Browse files
committed
docs: tweaks
1 parent b1c9402 commit 36c3ac5

File tree

26 files changed

+69
-44
lines changed

26 files changed

+69
-44
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH
9696
shell: bash
9797

98-
- name: NodeJS arch
98+
- name: Node.js arch
9999
run: node -e "console.log(process.arch)"
100100

101101
- name: Cache NPM dependencies

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# node-rs
22

3-
When `NodeJS` meet `Rust` = 🚀
3+
When `Node.js` meet `Rust` = 🚀
44

55
# napi-rs
66

7-
Make rust crates binding to NodeJS use [napi-rs](https://github.com/napi-rs/napi-rs)
7+
Make rust crates binding to Node.js use [napi-rs](https://github.com/napi-rs/napi-rs)
88

99
# Support matrix
1010

1111
| | node10 | node12 | node14 | node15 |
1212
| --------------- | ------ | ------ | ------ | ------ |
1313
| Windows x64 |||||
1414
| Windows x32 |||||
15-
| macOS x64/arm64 |||||
15+
| macOS x64 |||||
16+
| macOS arm64 |||||
1617
| Linux x64 gnu |||||
1718
| Linux x64 musl |||||
1819
| Linux arm gnu |||||
@@ -21,9 +22,9 @@ Make rust crates binding to NodeJS use [napi-rs](https://github.com/napi-rs/napi
2122

2223
# Packages
2324

24-
| Package | Status | Downloads | Description |
25-
| -------------------------------------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------- |
26-
| [`@node-rs/crc32`](./packages/crc32) | ![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg) | ![](https://img.shields.io/npm/dm/@node-rs/crc32.svg?sanitize=true) | Fastest `CRC32` implementation using `SIMD` |
27-
| [`@node-rs/jieba`](./packages/jieba) | ![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg) | ![](https://img.shields.io/npm/dm/@node-rs/jieba.svg?sanitize=true) | [`jieba-rs`](https://github.com/messense/jieba-rs) binding |
28-
| [`@node-rs/bcrypt`](./packages/bcrypt) | ![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg) | ![](https://img.shields.io/npm/dm/@node-rs/bcrypt.svg?sanitize=true) | Fastest bcrypt implementation |
29-
| [`@node-rs/deno-lint`](./packages/deno-lint) | ![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg) | ![](https://img.shields.io/npm/dm/@node-rs/deno-lint.svg?sanitize=true) | [deno_lint](https://github.com/denoland/deno_lint) nodejs binding |
25+
| Package | Status | Downloads | Description |
26+
| -------------------------------------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------ |
27+
| [`@node-rs/crc32`](./packages/crc32) | ![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg) | ![](https://img.shields.io/npm/dm/@node-rs/crc32.svg?sanitize=true) | Fastest `CRC32` implementation using `SIMD` |
28+
| [`@node-rs/jieba`](./packages/jieba) | ![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg) | ![](https://img.shields.io/npm/dm/@node-rs/jieba.svg?sanitize=true) | [`jieba-rs`](https://github.com/messense/jieba-rs) binding |
29+
| [`@node-rs/bcrypt`](./packages/bcrypt) | ![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg) | ![](https://img.shields.io/npm/dm/@node-rs/bcrypt.svg?sanitize=true) | Fastest bcrypt implementation |
30+
| [`@node-rs/deno-lint`](./packages/deno-lint) | ![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg) | ![](https://img.shields.io/npm/dm/@node-rs/deno-lint.svg?sanitize=true) | [deno_lint](https://github.com/denoland/deno_lint) Node.js binding |

packages/bcrypt/README.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg)
44
![](https://img.shields.io/npm/dm/@node-rs/bcrypt.svg?sanitize=true)
55

6-
🚀 Fastest bcrypt in NodeJS
6+
🚀 Fastest bcrypt in Node.js
77

88
## Support matrix
99

1010
| | node10 | node12 | node14 | node15 |
1111
| --------------- | ------ | ------ | ------ | ------ |
1212
| Windows x64 |||||
1313
| Windows x32 |||||
14-
| macOS x64/arm64 |||||
14+
| macOS x64 |||||
15+
| macOS arm64 |||||
1516
| Linux x64 gnu |||||
1617
| Linux x64 musl |||||
1718
| Linux arm gnu |||||
@@ -21,12 +22,32 @@
2122
## Usage
2223

2324
```typescript
24-
export const DEFAULT_ROUND = 12
25+
export const DEFAULT_COST: 12
2526

26-
function hashSync(password: string | Buffer, round?: number): string
27-
function hash(password: string | Buffer, round?: number): Promise<string>
28-
function verifySync(password: string | Buffer, hash: string | Buffer): boolean
29-
function verify(password: string | Buffer, hash: string | Buffer): Promise<boolean>
27+
export function hashSync(password: string | Buffer, round?: number): string
28+
export function hash(password: string | Buffer, round?: number): Promise<string>
29+
export function verifySync(password: string | Buffer, hash: string | Buffer): boolean
30+
export function verify(password: string | Buffer, hash: string | Buffer): Promise<boolean>
31+
/**
32+
* The same with `verifySync`
33+
*/
34+
export function compareSync(password: string | Buffer, hash: string | Buffer): boolean
35+
/**
36+
* The same with `verify`
37+
*/
38+
export function compare(password: string | Buffer, hash: string | Buffer): Promise<boolean>
39+
40+
export type Version = '2a' | '2x' | '2y' | '2b'
41+
/**
42+
* @param round default 10
43+
* @param version default '2b'
44+
*/
45+
export function genSaltSync(round?: number, version?: Version): string
46+
/**
47+
* @param round default 10
48+
* @param version default '2b'
49+
*/
50+
export function genSalt(round?: number, version?: Version): Promise<string>
3051
```
3152

3253
## Bench

packages/crc32/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg)
44
![](https://img.shields.io/npm/dm/@node-rs/crc32.svg?sanitize=true)
55

6-
Fastest `crc32` implement in `NodeJS`
6+
Fastest `crc32` implement in `Node.js`
77

88
The 4 tested implementations are:
99

@@ -46,7 +46,8 @@ js_crc32 for inputs 16931844B, avg 2066B x 22.12 ops/sec ±5.20% (40 runs sample
4646
| --------------- | ------ | ------ | ------ | ------ |
4747
| Windows x64 |||||
4848
| Windows x32 |||||
49-
| macOS x64/arm64 |||||
49+
| macOS x64 |||||
50+
| macOS arm64 |||||
5051
| Linux x64 gnu |||||
5152
| Linux x64 musl |||||
5253
| Linux arm gnu |||||

packages/deno-lint/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
![](https://github.com/napi-rs/node-rs/workflows/CI/badge.svg)
44
![](https://img.shields.io/npm/dm/@node-rs/deno-lint.svg?sanitize=true)
55

6-
> deno_lint nodejs binding
6+
> deno_lint Node.js binding
77
88
## Support matrix
99

1010
| | node10 | node12 | node14 | node15 |
1111
| --------------- | ------ | ------ | ------ | ------ |
1212
| Windows x64 |||||
1313
| Windows x32 |||||
14-
| macOS x64/arm64 |||||
14+
| macOS x64 |||||
15+
| macOS arm64 |||||
1516
| Linux x64 gnu |||||
1617
| Linux x64 musl |||||
1718
| Linux arm gnu |||||

packages/deno-lint/npm/android-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"cpu": ["arm64"],
66
"main": "deno-lint.android-arm64.node",
77
"files": ["deno-lint.android-arm64.node"],
8-
"description": "Deno lint binding for NodeJS",
8+
"description": "Deno lint binding for Node.js",
99
"keywords": ["Deno", "Lint", "ESLint", "node-rs", "napi", "N-API", "Rust", "napi-rs"],
1010
"author": "LongYinan <[email protected]>",
1111
"homepage": "https://github.com/napi-rs/node-rs",

packages/deno-lint/npm/darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"cpu": ["arm64"],
66
"main": "deno-lint.darwin-arm64.node",
77
"files": ["deno-lint.darwin-arm64.node"],
8-
"description": "Deno lint binding for NodeJS",
8+
"description": "Deno lint binding for Node.js",
99
"keywords": ["Deno", "Lint", "ESLint", "node-rs", "napi", "N-API", "Rust", "napi-rs"],
1010
"author": "LongYinan <[email protected]>",
1111
"homepage": "https://github.com/napi-rs/node-rs",

packages/deno-lint/npm/darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"cpu": ["x64"],
66
"main": "deno-lint.darwin-x64.node",
77
"files": ["deno-lint.darwin-x64.node"],
8-
"description": "Deno lint binding for NodeJS",
8+
"description": "Deno lint binding for Node.js",
99
"keywords": ["Deno", "Lint", "ESLint", "node-rs", "napi", "N-API", "Rust", "napi-rs"],
1010
"author": "LongYinan <[email protected]>",
1111
"homepage": "https://github.com/napi-rs/node-rs",

packages/deno-lint/npm/linux-arm-gnueabihf/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"cpu": ["arm"],
66
"main": "deno-lint.linux-arm-gnueabihf.node",
77
"files": ["deno-lint.linux-arm-gnueabihf.node"],
8-
"description": "Deno lint binding for NodeJS",
8+
"description": "Deno lint binding for Node.js",
99
"keywords": ["Deno", "Lint", "ESLint", "node-rs", "napi", "N-API", "Rust", "napi-rs"],
1010
"author": "LongYinan <[email protected]>",
1111
"homepage": "https://github.com/napi-rs/node-rs",

packages/deno-lint/npm/linux-arm64-gnu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"cpu": ["arm64"],
66
"main": "deno-lint.linux-arm64-gnu.node",
77
"files": ["deno-lint.linux-arm64-gnu.node"],
8-
"description": "Deno lint binding for NodeJS",
8+
"description": "Deno lint binding for Node.js",
99
"keywords": ["Deno", "Lint", "ESLint", "node-rs", "napi", "N-API", "Rust", "napi-rs"],
1010
"author": "LongYinan <[email protected]>",
1111
"homepage": "https://github.com/napi-rs/node-rs",

0 commit comments

Comments
 (0)