Skip to content

Add initial instructions to README #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,52 @@
![AS](https://avatars1.githubusercontent.com/u/28916798?s=48) node
======================

Implementations of the node.js APIs using wasi for use with AssemblyScript.
Implementations of the node.js APIs for AssemblyScript, utilizing [WASI](https://wasi.dev).

Introduction
------------

This library aims to provide a convenient node.js-like environment for AssemblyScript programs.
Please note that it is still in its early stages and that both the library and WASI are not even
close to be finalized.

As always, if the idea sounds appealing to you, feel free to improve existing APIs or to contribute
additional ones.

Instructions
------------

Install the library components as a dependency of your project

```
$> npm install --save-dev AssemblyScript/node
```

and include it in your build step to gain access to the implementations it provides:

```
$> asc --lib ./node_modules/@assemblyscript/node/assembly [...]
```

Doing so will automatically register common globals like the `Buffer` class and enables requiring
for example the filesystem module through `import * as fs from "fs"`.

Documentation
-------------

* [Status and API documentation on the wiki](https://github.com/AssemblyScript/node/wiki)
* [Implementation sources](./assembly)

Building
--------

To run the tests, first make sure that development dependencies are installed, then run:

```
$> npm test
```

One of the dependencies is [node-wasi](https://github.com/devsnek/node-wasi), which is a native
module. If you are running into issues when compiling it (on Windows), make sure that node-wasi
supports your version of node.js, that your machine can build native modules in the first place
and that your version of npm is recent (`npm install npm@latest -g`).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@assemblyscript/node",
"description": "Implementations of the node.js APIs for use with AssemblyScript.",
"description": "Implementations of the node.js APIs for AssemblyScript, utilizing WASI.",
"version": "0.1.0",
"license": "Apache-2.0",
"types": "assembly/node.d.ts",
Expand Down