Giter VIP home page Giter VIP logo

node-rs's Introduction

node-rs

When Node.js meet Rust = 🚀

napi-rs

Make rust crates binding to Node.js use napi-rs

Support matrix

node12 node14 node16 node18
Windows x64
Windows x32
Windows arm64
macOS x64
macOS arm64 (m chips)
Linux x64 gnu (glibc 2.17)
Linux x64 musl
Linux arm gnu (glibc 2.17)
Linux arm64 gnu (glibc 2.17)
Linux arm64 musl
Android arm64
Android armv7
FreeBSD x64

Packages

Package Version Downloads Description
@node-rs/crc32 Fastest CRC32 implementation using SIMD
@node-rs/jieba jieba-rs binding
@node-rs/bcrypt Fastest bcrypt implementation
@node-rs/deno-lint deno_lint Node.js binding
@node-rs/xxhash xxhash-rust Node.js binding
@node-rs/argon2 argon2 binding for Node.js.
@node-rs/jsonwebtoken jsonwebtoken binding for Node.js.

node-rs's People

Contributors

barbieri avatar brooooooklyn avatar dependabot-preview[bot] avatar dependabot[bot] avatar himself65 avatar mikescops avatar mohsen1 avatar nebarf avatar prantlf avatar renovate[bot] avatar richerfu avatar superhuangxu avatar tada5hi avatar vimutti77 avatar yisibl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-rs's Issues

deno-lint: ignore directives do not work

According to the docs, a // deno-lint-ignore directive should ignore a failing rule on the next line. The following is an example I ran where this fails:

~$ cat main.js
// deno-lint-ignore require-await
async function main() {
	console.log('hello world!');
}

main();
~$ npx denolint
error[require-await]: Async function 'main' has no 'await' expression.
 --> ~/main.js:2:1
  |
2 | / async function main() {
3 | | 	console.log('hello world!');
4 | | }
  | |_^
  |
  = help: Remove 'async' keyword from the function or use 'await' expression inside.

Binaries via optional dependencies doesn't get correct arch for Electron

When using electron-forge or electron-builder we generally build our Windows apps for both ia32 and x64.

On the surface, the optional dependencies route seems like a good idea but it doesn't work in the above case because npm optional modules are installed for the current nodejs architecture, not for the target Electron arch.

None of the Electron tooling appears aware of binaries via optional dependencies route so it doesn't work for one of the architectures.

incompatible with yarn2 PnP

In yarn2, any module you attempt to require() must be declared as a dependency in your own package.json. This means when @node-rs/helper attempts to, for example, require('@swc/core-linux'), it fails, because @swc/core-linux is not a dependency of @node-rs/helper

Fortunately, I think the solution is simple. @node-rs/helper needs to accept the caller's require function as an argument. Then when trying to require modules, it will use the caller's require, which is able to resolve the caller's dependencies. This is what we want, since we want to be sure that the modules we load match the versions that the caller wants to use.

For backwards compatibility, this can be optional, but it will probably cause issues with yarn 2 until the callers are updated to pass in a require function.

M1 chip running error

hi there
my project was copied from package templage,
yarn build and yarn test works right, but when other projects require this module, give me the following
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
image

reproduce steps

  1. execute command yarn link @${module_name} in the addon module dir
  2. execute command yarn link in the caller project dir
  3. use it let {xxx} = require('@${module_name}')

词性获取示例

能否提供一个获取词性的示例呢?
以及所有词性的清单
谢谢

denolint: no way to use a config file and check only some folders

Hi!

I would like to include some linting rules and exclude the dist directory.
The files field seems not supported in the config file. The combination of a config file and a path as argument seem not supported either (the path is ignored).

I tried the following config file:

{
  "files": {
    "include": ["src/"],
    "exclude": ["dist/"]
  },
  "rules": {
    "tags": ["recommended"],
    "include": [
      "camelcase"
    ]
  }
}

And the following commands:

npx denolint --config denolint.json
npx denolint --config denolint.json src/

It could be nice whether one of this (or both) could be supported.

Binding error: Docker on Mac M1 (arm64)

I tried installing a package that depends on SWC, @node-rs/helpers throws the following error.

Can not find node binding files from @swc/core-linux-arm64-gnu, @swc/core-linux-arm64-musl and /origin/aio/node_modules/@swc/core/swc.linux-arm64-gnu.node, /origin/aio/node_modules/@swc/core/swc.linux-arm64-musl.node

The environment is on node:14 docker image and the host machine is M1 Mac.

# Host 
$ uname -ms
Darwin arm64

# Container
$ uname -ms
Linux aarch64

I expect darwin/arm64 is supported but Linux/aarch64 isn't. Is it right? And how can I do to solve this error?

extract 可以產生 weight-value 嗎

您好,
請問extract可以產生 weight-value 嗎? 類似 node-jieba

ex :
//[ { word: 'CEO', weight: 11.739204307083542 },
// { word: '升职', weight: 10.8561552143 },
// { word: '加薪', weight: 10.642581114 },
// { word: '巅峰', weight: 9.49395840471 } ]

'loadBinding' in helper will not work in pnpm monorepo

When hoist is turned off in pnpm monorepo, packages which were not listed in package.json will not be accessible to current node path.
This leads a runtime failure like "TypeError: Not compatible with your platform. Error message: Cannot find module '@node-rs/crc32-darwin'"

Document that crc32's integer is unsigned

I'm using crc32c to create checksums that are stored in Postgres as an int. Their ints are signed, and often the result of crc32c() goes outside the bounds of a signed int (4 bytes, -2147483648 to +2147483647) because crc32c() returns an unsigned int value it seems. I can adjust with crc >>> 0 but it would be nice to document this in the API.

Even better, if the rust lib supports generating unsigned crc values then provide an option to do so.

Thanks for the fast lib!

@node-rs/xxhash crashes if used with node-loader

Reproduction: https://gist.github.com/BasixKOR/6841d085a82e0d7f8811d33894adf17c

Dump:

> require('./dist/foo.bundle.js')
node /c/Users/basix/Projects/repro-node-rs[16908]: c:\ws\src\node_buffer.cc:246: Assertion `val->IsArrayBufferView()' failed.
 1: 00007FF71FE0013F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112495
 2: 00007FF71FD8F396 DSA_meth_get_flags+65526
 3: 00007FF71FD8F751 DSA_meth_get_flags+66481
 4: 00007FF71FDB0F28 node::Buffer::Data+168
 5: 00007FF71FDC004F napi_get_buffer_info+79
 6: 00007FFDB69F2CCD napi_register_module_v1+2621
 7: 00007FF71FDCE7C7 node::Stop+36391
 8: 00007FF72067C3B6 v8::internal::Builtins::code_handle+172694
 9: 00007FF72067BFA9 v8::internal::Builtins::code_handle+171657
10: 00007FF72067C26C v8::internal::Builtins::code_handle+172364
11: 00007FF72067C0D0 v8::internal::Builtins::code_handle+171952
12: 00007FF72074F4E1 v8::internal::SetupIsolateDelegate::SetupHeap+494673
13: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
14: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
15: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
16: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
17: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
18: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
19: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
20: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
21: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
22: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
23: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
24: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
25: 00007FF7206DFB9C v8::internal::SetupIsolateDelegate::SetupHeap+37644
26: 00007FF7206DF79B v8::internal::SetupIsolateDelegate::SetupHeap+36619
27: 00007FF7205C0471 v8::internal::Execution::CallWasm+1521
28: 00007FF7205BFD5F v8::internal::Execution::Call+191
29: 00007FF7206C22EA v8::Script::Run+890
30: 00007FF71FD9AE88 node::OnFatalError+44392
31: 00007FF71FD9E5A6 node::OnFatalError+58502
32: 00007FF72067C3B6 v8::internal::Builtins::code_handle+172694
33: 00007FF72067BFA9 v8::internal::Builtins::code_handle+171657
34: 00007FF72067C26C v8::internal::Builtins::code_handle+172364
35: 00007FF72067C0D0 v8::internal::Builtins::code_handle+171952
36: 00007FF72074F4E1 v8::internal::SetupIsolateDelegate::SetupHeap+494673
37: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
38: 00007FF7206E198E v8::internal::SetupIsolateDelegate::SetupHeap+45310
39: 00000273D1FB74C1

Denolint CLI command does not fail on error

Hello 👋

First, thanks for these awesome bindings, these are awesome!

I'm having a question / feature request (it might be possible, but I don't know how): Is there a way to fail on error with the denolint CLI? I saw that it's possible with the Webpack plugin, but we would like to run denolint in our CI and see it fails if there is some errors.

Screenshot 2021-11-02 at 11 04 49

Introduce asynchronous methods to deno-lint

Checking the sources can take a long time. Blocking the whole JavaScript VM should be avoided. The API could be changed to support asynchronous execution and let retain the synchronous methods with the well-known Sync suffix. For example:

function lint(filepath: string, source: string, enableAllRules?: boolean): Promise<string[]>
function lintSync(filepath: string, source: string, enableAllRules?: boolean): string[]

function denolint(dirname: string, configPath: string): Promise<boolean>
function denolintSync(dirname: string, configPath: string): boolean

Would you be interested in such improvement?

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidTrailingBits'

  • NodeJS - 12.22.1
  • @node-rs/bcrypt - 1.5.0

calling verify function with malformed hash causes nodejs process to hang

POC:

const bcrypt = require('@node-rs/bcrypt');

try {
  const result = bcrypt.verifySync('test', '$2b$10$heNneCqWJ6/hd5pb.Pbgs.Jzc/qnqf3gQRNiGkr9KbS2yFdozfQ50');
  console.log(result);
} catch (e) {
  console.log(e);
}

Output:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidTrailingBits', packages/bcrypt/src/b64.rs:181:23
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
[1]    17750 abort      node bcrypt-panic-poc.js

I have changed last character of hash from 2 to 0

Windows Server 2008R2下报错该如何解决?

服务器:Windows Server 2008R2
node版本:v12.18.3
安装报错:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse vents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} )
启动报错:
(node:4904) UnhandledPromiseRejectionWarning: Error: The specified module could not be found. \\?\F:\diffTest_server\node_modules\@node-rs\jieba\jieba.win32.node at Object.Module._extensions..node (internal/modules/cjs/loader.js:1187:18) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at loadBinding (F:\diffTest_server\node_modules\@node-rs\helper\lib\loader.j s:27:12) at Object.<anonymous> (F:\diffTest_server\node_modules\@node-rs\jieba\index. js:3:16) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) (node:4904) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To termina te the node process on unhandled promise rejection, use the CLI flag --unhandle
d-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejectio ns_mode). (rejection id: 2) (node:4904) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre cated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Use denolint as a binary directly without cli.js

Similarly to esbuild, why not building denolint as a Rust executable and call it directly on the command line? Less complexity, better performance.

The command line executable is usually used alone. If linting is integrated to webpack, rollup or other bundler, the library with the lint export will be used programmatically instead of the executable. For example, the deno_lint package could be split to denolint producing just the executable and libdenolint producing just the library with the Node.js bindings:

├── crates
│   ├── alloc
│   │   ├── Cargo.toml
│   │   └── src
│   │       └── lib.rs
│   └── shared                  # config and diagnostics moved here
│       ├── Cargo.toml
│       └── src
│           ├── config.rs
│           ├── diagnostics.rs
│           └── lib.rs
└── packages
    ├── denolint                # depends on alloc and shared
    │   ├── Cargo.toml
    │   ├── package.json
    │   └── src
    │       └── main.rs
    └── libdenolint             # depends on alloc and shared
        ├── Cargo.toml
        ├── build.rs
        ├── index.d.ts
        ├── index.js
        ├── package.json
        └── src
            └── lib.rs

Would you be interested in such change?

@node-rs/helper incompatible with asset relocation

Both ncc and electron-forge rely on @vercel/webpack-asset-relocator-loader to locate and copy native node assets.

@vercel/webpack-asset-relocator-loader supports many conventions, works with wildcards, __dirname and has special cases for historic ways to load a native binary (ie. require('bindings')(...), nbind.init(..), etc). However, it's analysis fails to make sense of the binding loading code in @node-rs/helper because it's too complex.

To reproduce:

package.json

{
  "name": "ncc-test",
  "version": "1.0.0",
  "main": "dist/index.js",
  "license": "MIT",
  "scripts": {
    "start": "node ./dist/index.js -v",
    "build": "ncc build index.js -o dist"
  },
  "devDependencies": {
    "@vercel/ncc": "^0.27.0"
  },
  "dependencies": {
    "@node-rs/crc32": "^1.0.0"
  }
}

index.js

const crc = require("@node-rs/crc32");
const out = crc.crc32(Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]));
console.log("out", out);

Run

yarn && yarn build && yarn run

Result:
Can not find node binding files from @node-rs/crc32-darwin-x64 and /Users/timfish/Documents/Repositories/ncc-test/dist/crc32.darwin-x64.node

How to ensure my Rust environment is setup right for this repo?

Hi,

N00b Rust learner here. I'm trying to build the packages in main (3e555f1) using yarn build and getting the following error:

 ~/C/node-rs    yarn build                                             36.3s  Tue Jan 18 13:52:57 2022
yarn run v1.22.11
$ lerna run build --concurrency 1 --stream --no-prefix
lerna notice cli v4.0.0
lerna info versioning independent
lerna info Executing command in 7 packages: "yarn run build"
$ napi build --platform --release --pipe "prettier -w"
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.112
   Compiling autocfg v1.0.1
   Compiling typenum v1.15.0
   Compiling lazy_static v1.4.0
   Compiling proc-macro2 v1.0.36
   Compiling version_check v0.9.4
   Compiling crossbeam-utils v0.8.6
error: the option `Z` is only accepted on the nightly compiler
error: the option `Z` is only accepted on the nightly compiler
error: the option `Z` is only accepted on the nightly compiler
error: the option `Z` is only accepted on the nightly compiler
error: the option `Z` is only accepted on the nightly compiler
error: the option `Z` is only accepted on the nightly compiler
error: the option `Z` is only accepted on the nightly compiler
error: the option `Z` is only accepted on the nightly compiler
error: could not compile `typenum`
warning: build failed, waiting for other jobs to finish...
error: build failed
Internal Error: Command failed: cargo build --release
    at checkExecSyncError (child_process.js:635:11)
    at Object.execSync (child_process.js:671:15)
    at BuildCommand.<anonymous> (/Users/mohsen_azimi/Code/node-rs/node_modules/@napi-rs/cli/scripts/index.js:12797:26)
    at Generator.next (<anonymous>)
    at /Users/mohsen_azimi/Code/node-rs/node_modules/@napi-rs/cli/scripts/index.js:1678:71
    at new Promise (<anonymous>)
    at __awaiter$1 (/Users/mohsen_azimi/Code/node-rs/node_modules/@napi-rs/cli/scripts/index.js:1674:12)
    at BuildCommand.execute (/Users/mohsen_azimi/Code/node-rs/node_modules/@napi-rs/cli/scripts/index.js:12721:16)
    at BuildCommand.validateAndExecute (/Users/mohsen_azimi/Code/node-rs/node_modules/@napi-rs/cli/scripts/index.js:204:37)
    at /Users/mohsen_azimi/Code/node-rs/node_modules/@napi-rs/cli/scripts/index.js:1261:53
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run build exited 1 in '@node-rs/argon2'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
 !  ~/C/node-rs                                                      2766ms  Tue Jan 18 13:53:02 2022

My Rust versions:

rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/mohsen_azimi/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
nightly-2021-12-05-x86_64-apple-darwin

active toolchain
----------------

nightly-2021-12-05-x86_64-apple-darwin (overridden by '/Users/mohsen_azimi/Code/node-rs/rust-toolchain')
rustc 1.59.0-nightly (efec54529 2021-12-04)

Critical dependencies

I've installed a package that has node-rs/helper@^1.2.0 as a dependency in my create-react-app project and I'm getting these warnings when running the dev server:

./node_modules/@node-rs/helper/lib/loader.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

./node_modules/@node-rs/helper/lib/loader.js 25:15-27:11
Critical dependency: the request of a dependency is an expression

./node_modules/@node-rs/helper/lib/loader.js
Critical dependency: the request of a dependency is an expression

Install @node-rs/jieba failed

$ npm i @node-rs/jieba                                  
npm ERR! Cannot read properties of null (reading 'package')

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/modu/.npm/_logs/2022-02-21T14_36_43_662Z-debug-0.log

$ npm i @node-rs/jieba --registry=https://registry.npmmirror.com 
npm ERR! Cannot read properties of null (reading 'package')

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/modu/.npm/_logs/2022-02-21T14_37_31_188Z-debug-0.log

$ pnpm i @node-rs/jieba
 WARN  GET https://registry.npmjs.org/expect.js/download/expect.js-0.3.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/react-json-view/download/react-json-view-1.21.3.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/nock/download/nock-13.2.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/mock-aws-s3/download/mock-aws-s3-4.0.2.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/gh-pages/download/gh-pages-3.2.3.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/benchmark/download/benchmark-1.0.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/aurl/download/aurl-1.2.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/aws-sdk/download/aws-sdk-2.1045.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint/download/eslint-0.24.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/mocha/download/mocha-9.1.3.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/nyc/download/nyc-15.1.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/object-assign/download/object-assign-4.1.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/request/download/request-2.68.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/istanbul/download/istanbul-0.3.22.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/dumi/download/dumi-1.1.36.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/commander/download/commander-1.1.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/expect.js/download/expect.js-0.3.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/react-json-view/download/react-json-view-1.21.3.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/mock-aws-s3/download/mock-aws-s3-4.0.2.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/nock/download/nock-13.2.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/aws-sdk/download/aws-sdk-2.1045.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/aurl/download/aurl-1.2.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/eslint/download/eslint-0.24.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/gh-pages/download/gh-pages-3.2.3.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/benchmark/download/benchmark-1.0.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/object-assign/download/object-assign-4.1.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/istanbul/download/istanbul-0.3.22.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/dumi/download/dumi-1.1.36.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/request/download/request-2.68.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/mocha/download/mocha-9.1.3.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/nyc/download/nyc-15.1.0.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/commander/download/commander-1.1.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/mock-aws-s3/download/mock-aws-s3-4.0.2.tgz: Not Found - 404

No authorization header was set for the request.
Progress: resolved 2, reused 2, downloaded 0, added 0

[bcrypt] Doesn't work on alpine

I'm still looking into it.

I tried installing gcompat or libc6-compat:

Error relocating /usr/node_modules/@node-rs/bcrypt/bcrypt.linux.node: __register_atfork: symbol not found

Without them:

Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/node_modules/@node-rs/bcrypt/bcrypt.linux.node)

My dockerfile:

FROM node:14-alpine

# Create app directory
RUN mkdir -p /usr
WORKDIR /usr

COPY package*.json ./
RUN apk add --no-cache gcompat \
    && npm install --production

Loading linux musl addon Error: Cannot find module '@node-rs/bcrypt-linux-musl'

After installing on alpine docker container, I see such an error:

Loading linux musl addon Error: Cannot find module '@node-rs/bcrypt-linux-musl'
Require stack:
- /usr/src/app/node_modules/@node-rs/helper/lib/loader.js
- /usr/src/app/node_modules/@node-rs/helper/lib/index.js
- /usr/src/app/node_modules/@node-rs/bcrypt/index.js
- /usr/src/app/node_modules/http-auth/src/auth/basic.js
- /usr/src/app/node_modules/http-auth/src/http-auth.js

Could you please help me to handle it.

Typescript error with @node-rs/xxhash

node_modules/@node-rs/xxhash/index.d.ts:30:25 - error TS1183: An implementation cannot be declared in ambient contexts.

30   private constructor() {}
                           ~

I am using typescript 4.3.5 in strict mode.

deno-lint: cli ignores path

Hope you don't mind me submitting 2 separate issues at once, but I don't think this is related to #630.

It seems the denolint cli ignores the path parameter and lints everything recursively, starting at the cwd. Example where I point it at a file with a single script, and it lints a second script in the current directory anyway:

~$ tree
.
├── main.js
└── test
    └── main2.js

1 directory, 2 files
~$ npx denolint test
error[require-await]: Async function 'main' has no 'await' expression.
 -->~/test/main2.js:2:1
  |
2 | / async function main() {
3 | | 	console.log('hello world!');
4 | | }
  | |_^
  |
  = help: Remove 'async' keyword from the function or use 'await' expression inside.
error[require-await]: Async function 'main' has no 'await' expression.
 --> ~/test/main.js:2:1
  |
2 | / async function main() {
3 | | 	console.log('hello world!');
4 | | }
  | |_^
  |
  = help: Remove 'async' keyword from the function or use 'await' expression inside. 

Browser support?

Would it be possible to get @node-rs/jieba working as a client side library for the browser?

How to pass `salt` generated via `genSalt` to bcrypt `hash()`?

There are bcrypt functions exposed for generating salts (genSalt/genSaltSync), but it doesn't seem possible to pass their returned values to hash() as an alternative to the rounds parameter. I didn't see anything in the documentation or examples -- and it didn't seem possible in the source nor did there seem to be any tests that combined the functions. Did I just miss how to do it? Or is this an oversight / just not supported yet?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.