Skip to content

Commit

Permalink
Adds initial documentation for NPM package installation
Browse files Browse the repository at this point in the history
  • Loading branch information
raugfer committed Sep 30, 2024
1 parent fa27403 commit c18e918
Showing 1 changed file with 59 additions and 1 deletion.
60 changes: 59 additions & 1 deletion docs/gitbook/installation/npm-package.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
# Npm package

soon
## Installation via NPM Registry (recommended)

The easiest way to install Garaga is via your prefered Node.js package manager, such as `npm` or `yarn`.

1. Open your terminal or command prompt.
2. Run the following command:

```bash
npm i -S garaga
```

or

```bash
yarn add garaga
```

{% hint style="info" %}
{% endhint %}

## Building the package from source code

The package can be build directly from source code by cloning the garaga repository. Make sure you have both [Rust](https://www.rust-lang.org/tools/install) and [Node.js](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs) installed in you machine.

1. Open your terminal or command prompt.
2. Install wasm-pack by running:
```bash
cargo install wasm-pack
```
3. Run the following commands:

```bash
git clone https://github.com/keep-starknet-strange/garaga.git
cd tools/npm/garaga_ts
npm ci
npm run build
npm pack
```
4. The .tgz file with the package contents will be available in the current folder.
5. Install the .tgz file in your project
```bash
npm i -S <path-to-tgz-package-file>
```

For reproducible builds, one can use instead docker compose. Make sure [docker](https://docs.docker.com/engine/install/) is installed in you machine.

1. Open your terminal or command prompt.
2. Run the following commands:

```bash
git clone https://github.com/keep-starknet-strange/garaga.git
cd tools/npm/garaga_ts
docker compose up --build
```
3. The .tgz file with the package contents will be available in the current folder.
4. Install the .tgz file in your project
```bash
npm i -S <path-to-tgz-package-file>
```

0 comments on commit c18e918

Please sign in to comment.