Skip to content

Commit

Permalink
chore(bindings/nodejs): fix missing files to publish
Browse files Browse the repository at this point in the history
Signed-off-by: suyanhanx <[email protected]>
  • Loading branch information
suyanhanx committed Mar 10, 2023
1 parent 0be8ec7 commit 2d44130
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/bindings_nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ jobs:
- name: Move artifacts
run: yarn artifacts

- name: Build to generate main files
run: yarn build

- name: List packages
run: ls -R ./npm
shell: bash
Expand Down
9 changes: 5 additions & 4 deletions bindings/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@ npm install opendal
```

## Docs
- see [index.d.ts](./index.d.ts)

see [index.d.ts](./index.d.ts)

## Usage

```javascript
import { Operator, Scheme } from 'opendal'
import { Operator, Scheme } from "opendal";

async function main() {
const op = new Operator(Scheme.Fs, { root: '/tmp' });
const op = new Operator("fs", { root: "/tmp" });
await op.write("test", "Hello, World!");
const bs = await op.read("test");
console.log(new TextDecoder().decode(bs));
const meta = await op.stat("test");
console.log(`contentLength: ${meta.contentLength}`);
}

main()
main();
```


Expand Down
3 changes: 1 addition & 2 deletions bindings/nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

/// <reference types="node" />

const { Operator, Scheme } = require('./generated.js')
const { Operator } = require('./generated.js')

module.exports.Operator = Operator
module.exports.Scheme = Scheme
3 changes: 3 additions & 0 deletions bindings/nodejs/npm/darwin-x64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@opendal/lib-darwin-x64`

This is the **x86_64-apple-darwin** binary for `opendal`
3 changes: 3 additions & 0 deletions bindings/nodejs/npm/linux-x64-gnu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@opendal/lib-linux-x64-gnu`

This is the **x86_64-unknown-linux-gnu** binary for `opendal`
3 changes: 3 additions & 0 deletions bindings/nodejs/npm/win32-x64-msvc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@opendal/lib-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `opendal`
16 changes: 16 additions & 0 deletions bindings/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@
"napi": {
"name": "opendal"
},
"keywords": [
"api",
"fs",
"file system",
"gcs",
"ghac",
"http",
"ipmfs",
"memory",
"obs",
"oss",
"s3",
"storage",
"webdav",
"webhdfs"
],
"files": [
"index.d.ts",
"index.js",
Expand Down
2 changes: 0 additions & 2 deletions licenserc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ excludes = [
"**/fixtures/**",
"tests/data/**",
"bindings/nodejs/.npmignore",
"bindings/nodejs/generated.js",
"bindings/nodejs/index.d.ts",
"bindings/python/test_requirements.txt",

# Env example that doesn't need license.
Expand Down

0 comments on commit 2d44130

Please sign in to comment.