open-index/open-npm huggingface dataset:
npm package: @mantou/ecs
Description: A simple JavaScript ECS library for NESBox Sandbox
Latest version: 0.0.3

# ECS

A simple JavaScript ECS library for NESBox Sandbox

## Example

```js
const helloWorld = (world) => {
  console.log('hello');
  for (const entity of world.getEntitiesIter()) {
    if (entity.hasComponent(SizeComponent)) {
      // do something...
    }
  }
};

const world = new World(256, 240)
  .addEntity(new BasicEntity().addComponent(new SizeComponent(10, 10)))
  .addSystem(helloWorld);

world.getVideoFrame();
world.getAudioFrame();
world.getState();
```

Custom `Component`:

```js
@registerComponent()
export class NewPieceComponent extends Component {}
```
npm package: @mantou/nes
Description: ```bash git submodule update ```
Latest version: 1.0.16

# @mantou/nes

## pull deps

```bash
git submodule update
```

## compile to wasm

[install](https://rustwasm.github.io/wasm-pack/installer/) wasm-pack.

```bash
# development
cargo watch -s "wasm-pack build --out-dir ../nes-pkg --target web --scope mantou --profiling"
# or
cargo watch -s "wasm-pack build --out-dir ../nes-pkg --target web --scope mantou --debug"
# build
wasm-pack build --out-dir ../nes-pkg --target web --scope mantou
```

## publish to npm

use `yarn publish:nes` at root directory
npm package: @mantou/nes-sandbox
Description: A secure runtime for running JavaScript games in NESBox.
Latest version: 0.0.13

# Sandbox

A secure runtime for running JavaScript games in NESBox.

## Example

```js
nesbox.init({
  width: 256,
  height: 240,
  getVideoFrame: () => {
    return getVideoFrame();
  },
  getAudioFrame: () => {
    return getAudioFrame();
  },
  getState: () => {
    return getState();
  },
  setState: (state) => {
    setState(state);
  },
});
```

Read user input:

```js
nesbox.isTap(nesbox.players.One, nesbox.buttons.Start);
nesbox.isPressed(nesbox.players.One, nesbox.buttons.Start);
nesbox.getCursor(nesbox.players.One)；
```
npm package: @mantou/nes-wasm4
Description: This directory contains the web runtime.
Latest version: 0.0.6

This directory contains the web runtime.

## Development

First run `npm run prepare` to build `@wasm4/web-devtool`.
Then run `npm install` to install dependencies.

For quick development run `npm start` and navigate to http://localhost:3000.
You will also need to place a test cartridge in public/cart.wasm.

You can create a cartridge with the `w4` tool. You can build that in `cli`
directory with `npm i`, then just run the `cli.js` file.

Run `npm run build` to build a release build, which is used by the website and the `w4` CLI.