open-index/open-npm huggingface dataset:
npm package: @garethtdavies/client-sdk
Description: Node API for signing transactions for Coda Protocol
Author: o1labs
Latest version: 0.1.5

# Coda Client Javascript SDK

This is a NodeJS client SDK that allows you to sign transactions and strings using Coda's keypairs.
The project contains Typescript and ReasonML typings but can be used from plain NodeJS as well. 

# Install
```bash
yarn add @o1labs/client-sdk
# or with npm:
npm install --save @o1labs/client-sdk
```

# Usage
Typescript:
```typescript
import * as CodaSDK from "@o1labs/client-sdk";

let keys = CodaSDK.genKeys();
let signed = CodaSDK.signMessage("hello", keys);
if (CodaSDK.verifyMessage(signed)) {
    console.log("Message was verified successfully")
};

let signedPayment = CodaSDK.signPayment({
    to: keys.publicKey,
    from: keys.publicKey,
    amount: 1,
    fee: 1,
    nonce: 0
  }, keys);
```

NodeJS:
```javascript
const CodaSDK = require("@o1labs/client-sdk");

let keys = CodaSDK.genKeys();
let signed = CodaSDK.signMessage("hello", keys);
if (CodaSDK.verifyMessage(signed)) {
    console.log("Message was verified successfully")
};

let signedPayment = CodaSDK.signPayment({
    to: keys.publicKey,
    from: keys.publicKey,
    amount: 1,
    fee: 1,
    nonce: 0
  }, keys);
```

ReasonML:
- Install gentype: `yarn add -D gentype`
- Install bs-platform: `yarn add -D bs-platform`
- Build dependencies: `yarn bsb -make-world`

```reason
module CodaSDK = O1labsClientSdk.CodaSDK;

let keys = CodaSDK.genKeys();
let signed = CodaSDK.signMessage(. "hello", keys);
if (CodaSDK.verifyMessage(. signed)) {
  Js.log("Message was verified successfully");
};

let signedPayment = CodaSDK.signPayment({
    to_: keys.publicKey,
    from: keys.publicKey,
    amount: "1",
    fee: "1",
    nonce: "0"
  }, keys);

```

# API Reference
- [Main API](src/CodaSDK.d.ts)
- [Other](src/SDKWrapper.d.ts)
npm package: @garfenter/paquete
Description: Ejemplo de como crear un paquete para NPM
Author: Juan Luis Cano
Latest version: 0.0.1

# Paquete NPM

Este proyecto es una prueba de creación de paquete para [NPM](https://www.npmjs.com/)
Este paquete únicamente permite la 

## Pasos 

- Crear proyecto de npm con el comando `npm init`, esto creará el archivo package.json

## Instalación

```
npm install paquete
```

## Uso

```
import { add } from 'paquete'

add(5,3) //8
add(6,2) //8
add(10, 4) //14
```

## Créditos
- Juan Luis Cano

## Licencia
[MIT](https://opensource.org/licenses/MIT)
npm package: @garfieldcmix/tree-sitter-miniscript
Description: Miniscript grammar for tree-sitter
Author: Garfieldcmix
Latest version: 1.0.2

# tree-sitter-miniscript

A [Tree-sitter](https://tree-sitter.github.io/) grammar for the MiniScript programming language.

> This parser can be used in editors, code analysis tools, and other applications that leverage Tree-sitter for parsing and syntax highlighting.
npm package: @garfish/bridge-react
Description: garfish module.
Author: danpeen <dapeen.feng@gmail.com
Latest version: 1.19.8

# `@garfish/bridge-react`

[![NPM version](https://img.shields.io/npm/v/@garfish/bridge-react.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/bridge-react)

## Usage

```jsx
// child app
import { reactBridge } from '@garfish/bridge-react';
function App() {
  return <div>content</div>;
}
export const provider = reactBridge({
  el: '#root',
  rootComponent: App,
});
```

## Contributing

- [Contributing Guide](https://github.com/modern-js-dev/garfish/blob/main/CONTRIBUTING.md)

## Credit

- [single-spa](https://github.com/single-spa/single-spa) for community raised a hot wave of micro front-end solutions, and we refer to the implementation of the bridge part in [single-spa](https://github.com/single-spa/single-spa) and we think it is a good design, so we fork the code of the bridge implementation part and make some adjustments for the lifecycles in Garfish.
npm package: @garfish/bridge-react-v18
Description: garfish module.
Author: danpeen <dapeen.feng@gmail.com
Latest version: 1.19.8

# `@garfish/bridge-react-v18`

[![NPM version](https://img.shields.io/npm/v/@garfish/bridge-react-v18.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/bridge-react-v18)

## Usage

```jsx
// child app
import { reactBridge } from '@garfish/bridge-react-v18';

function App() {
  return <div>content</div>;
}

export const provider = reactBridge({
  el: '#root',
  rootComponent: App,
});
```

## Contributing

- [Contributing Guide](https://github.com/modern-js-dev/garfish/blob/main/CONTRIBUTING.md)

## Credit

- [single-spa](https://github.com/single-spa/single-spa) for community raised a hot wave of micro front-end solutions, and we refer to the implementation of the bridge part in [single-spa](https://github.com/single-spa/single-spa) and we think it is a good design, so we fork the code of the bridge implementation part and make some adjustments for the lifecycles in Garfish.
npm package: @garfish/bridge-vue-v2
Description: garfish vue bridge for v2.
Author: danpeen <dapeen.feng@gmail.com
Latest version: 1.19.8

# `"@garfish/bridge-vue-v2`

[![NPM version](https://img.shields.io/npm/v/@garfish/bridge-vue-v2.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/bridge-vue-v2)

Vue bridge for vue v2 subapp. For more details, [check here](https://www.garfishjs.org/guide/bridge)
## Usage

```js
// child app
import { vueBridge } from '@garfish/bridge-vue-v2';

function App() {
  return <div>content</div>;
}

export const provider = vueBridge({
  // rootComponent、loadRootComponent 传递一个即可。二者同时存在时，取 loadRootComponent 的返回值值作为 root component.
  rootComponent: App,
  loadRootComponent: ({ basename, dom, appName, props }) => {
    // do something async
    return Promise.resolve(App);
  },
  handleInstance: (vueInstance, { basename, dom, appName, props }) => {
    // you can do something in handleInstance after get the vueInstance
  },
  appOptions: ({ basename, dom, appName, props }) => {
    // pass the options to Vue Constructor. check https://vuejs.bootcss.com/api/#%E9%80%89%E9%A1%B9-%E6%95%B0%E6%8D%AE
    return {
      el: '#app',
      router: newRouter(basename),
      store,
    };
  },
});

```

## Contributing

- [Contributing Guide](https://github.com/modern-js-dev/garfish/blob/main/CONTRIBUTING.md)

## Credit

- [single-spa](https://github.com/single-spa/single-spa) for community raised a hot wave of micro front-end solutions, and we refer to the implementation of the bridge part in [single-spa](https://github.com/single-spa/single-spa) and we think it is a good design, so we fork the code of the bridge implementation part and make some adjustments for the lifecycles in Garfish.
npm package: @garfish/bridge-vue-v3
Description: garfish vue bridge for v3.
Author: danpeen <dapeen.feng@gmail.com
Latest version: 1.19.8

# `@garfish/bridge-vue-v3`

[![NPM version](https://img.shields.io/npm/v/@garfish/bridge-vue-v3.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/bridge-vue-v3)

Vue bridge for vue v3 subapp. For more details, [check here](https://www.garfishjs.org/guide/bridge)
## Usage

```jsx
// child app
import { vueBridge } from '@garfish/bridge-vue-v3';

function App() {
  return <div>content</div>;
}

export const provider = vueBridge({
  rootComponent: App,
  appOptions: ({ basename, dom, appName, props }) => {
    // pass the options to createApp. check hhttps://vuejs.org/api/application.html#createApp
    return {
      el: '#app',
      render: () => h(App),
    };
  },
  handleInstance: (vueInstance, { basename, dom, appName, props }) => {
    // you can do something in handleInstance after get the vueInstance
    vueInstance.use(newRouter(basename));
    vueInstance.provide(stateSymbol, createState());
  },
});

```

## Contributing

- [Contributing Guide](https://github.com/modern-js-dev/garfish/blob/main/CONTRIBUTING.md)

## Credit

- [single-spa](https://github.com/single-spa/single-spa) for community raised a hot wave of micro front-end solutions, and we refer to the implementation of the bridge part in [single-spa](https://github.com/single-spa/single-spa) and we think it is a good design, so we fork the code of the bridge implementation part and make some adjustments for the lifecycles in Garfish.
npm package: @garfish/browser-snapshot
Description: browser-snapshot module.
Author: zhouxiao <codingzx@gmail.com>
Latest version: 1.19.8

# `@garfish/browser-snapshot`

[![NPM version](https://img.shields.io/npm/v/@garfish/browser-snapshot.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/browser-snapshot)

## Usage

```js
import spSandbox from '@garfish/browser-snapshot';

// TODO: DEMONSTRATE API
```
npm package: @garfish/browser-vm
Description: vm-sandbox module.
Author: zhouxiao.shaw <codingzx@gmail.com>
Latest version: 1.19.8

# `@garfish/browser-vm`

[![NPM version](https://img.shields.io/npm/v/@garfish/browser-vm.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/browser-vm)

## Usage

```js
import vmSandbox from '@garfish/browser-vm';

let nameMap = { a: 'chen' };

const sandbox = new vmSandbox({
  namespace: 'app',
  el: () => document.body,
  modules: [
    () => ({
      override: { nameMap },
      recover() {
        nameMap = { a: 'chen' };
      },
    }),
  ],
});

sandbox.execScript(`
  window.x = 1;
  console.log(window.nameMap); // { a: 'chen' }
  window.nameMap.a = 'tao';
`);

console.log(sandbox.global.x); // 1
console.log(sandbox.global.nameMap); // { a: 'tao' }

// Clear effect
sandbox.clearEffects();
console.log(nameMap); // { a: 'chen' }

// If clear all effects
sandbox.reset();
```

## Hooks

```js
const sandbox = new vmSandbox({
  namespace: 'app',
  el: () => document.body,
});

sandbox.hooks.usePlugin({
  stared(fakeWindow) {},
  closed() {},
  beforeClearEffect() {},
  afterClearEffect() {},
  beforeInvoke(url, env, options) {},
  afterInvoke(url, env, options) {},
  invokeError(err, url, env, options) {},
  appendNode(parentNode, oldNode, convertedNode, tagName) {},
});
```
npm package: @garfish/core
Description: core module.
Author: zhouxiao<codingzx@gmail.com>
Latest version: 1.19.8

# `@garfish/core`

[![NPM version](https://img.shields.io/npm/v/@garfish/core.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/core)

## Usage

```shell
$ yarn add @garfish/core @garfish/cjs-app @garfish/router @garfish/browser-vm @garfish/browser-snapshot
```

```js
import Garfish from '@garfish/core';
import { GarfishRouter } from '@garfish/router';
import { GarfishBrowserVm } from '@garfish/browser-vm';
import { GarfishBrowserSnapshot } from '@garfish/browser-snapshot';

const GarfishInstance = new Garfish({
  apps,
  plugins: [GarfishRouter(), GarfishBrowserVm(), GarfishBrowserSnapshot()],
});
```

## loadApp

```js
import Garfish from '@garfish/core';
import { GarfishBrowserVm } from '@garfish/browser-vm';

const GarfishInstance = new Garfish({
  plugins: [GarfishBrowserVm()],
  beforeLoad: async (appInfo, options) => {
    // `return false` will prevent the app from loading
    // return false;
  },
  afterLoad: (appInfo, options) => {},
  beforeEval: (appInfo, code, env, url, options) => {},
  afterEval: (appInfo, code, env, url, options) => {},
  beforeMount: (appInfo, app) => {},
  afterMount: (appInfo, app) => {},
  beforeUnmount: (appInfo, app) => {},
  afterUnmount: (appInfo, app) => {},
  errorLoadApp: (err, appInfo) => console.error(err),
  errorMountApp: (err, appInfo) => console.error(err),
  errorUnmountApp: (err, appInfo) => console.error(err),
  errorExecCode: (err, appInfo) => console.error(err),
});

// `appName` is globally unique.
GarfishInstance.loadApp('appName', 'https://xx.html').then(async (app) => {
  if (!app) return;
  let mountSuccess;
  try {
    mountSuccess = await app.mount();
  } catch (e) {
    // If you add the `errorMountApp` hook, no error will be thrown here
    console.log(e);
  }

  if (mountSuccess) {
    document.body.appendChild(app.appContainer);
    // unmount
    setTimeout(() => {
      const unmountSuccess = app.unmout();
      console.log(unmountSuccess);
    }, 1000);
  }
});
```

You can also pass more complex parameters.

```js
GarfishInstance.loadApp('appName', {
  cache: true,
  entry: 'https://xx.html',
  domGetter: '#appContainer', // When the child application is rendered, it will be mounted here
}).then(async (app) => {
  if (!app) return;
  // ...
});
```
npm package: @garfish/css-scope
Description: css scope
Author: chentao.arthur <chentao.arthur@bytedance.com>
Latest version: 1.19.8

# `@garfish/css-scope`

[![NPM version](https://img.shields.io/npm/v/@garfish/css-scope.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/css-scope)

Inspired by [reworkcss/css](https://github.com/reworkcss/css).

> [TJ](https://github.com/tj) is my idol.

## Usage

> Need webAssembly support

```js
import { parse, stringify } from '@garfish/css-scope';

const code = 'a { color: #fff; }';
const ast = parse(code);
const scopedCode = stringify(ast, 'App'); // #App a { color: #fff; }
```

## Use in Garfish

```js
import { GarfishCssScope } from '@garfish/css-scope';

Garfish.run({
  ...
  plugins: [
    GarfishCssScope({
      fixBodyGetter: true,
      excludes: ['appName'],
    }),
  ],
})
```
npm package: @garfish/es-module
Description: es module polyfill
Author: chentao.arthur <chentao.arthur@bytedance.com>
Latest version: 1.19.8

# `@garfish/es-module`

[![NPM version](https://img.shields.io/npm/v/@garfish/es-module.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/es-module)

Inspired by [virtual-es-module](https://github.com/imtaotao/virtual-es-module).

## Usage

```js
import Runtime from '@garfish/es-module';
// One runtime, one project
const runtime = new Runtime();

const module = await runtime.importByUrl('./a.mjs');
console.log(module);

const module = await runtime.importByCode(`
  import * as m from './a.mjs';
  export default 1;
`);
console.log(module);
```

## Use in Garfish

`@garfish/es-module` will bring serious above-the-fold performance problems, child applications should not use `esModule` in production environments.

```js
import { GarfishEsModule } from '@garfish/es-module';

Garfish.run({
  ...
  plugins: [
    ...
    GarfishEsModule({
      excludes: ['appName'],
    }),
  ],
})
```
npm package: @garfish/hooks
Description: hooks module.
Author: chentao.arthur <chentao.arthur@bytedance.com>
Latest version: 1.19.8

# `@garfish/hooks`

[![NPM version](https://img.shields.io/npm/v/@garfish/hooks.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/hooks)

## Usage

```js
import { AsyncHook, PluginSystem } from '@garfish/hooks';

const hooks = new PluginSystem({
  a: new AsyncHook(),
});

hooks.usePlugin({
  async a(a, b) {
    console.log(a, b);
  },
});

hooks.lifecycle.a.emit(1, 2);
```

Inherit parent hooks.

```js
import { AsyncHook, PluginSystem } from '@garfish/hooks';

const hooks1 = new PluginSystem({
  a: new AsyncHook(),
});

const hooks2 = new PluginSystem({
  b: new AsyncHook(),
});

hooks2.inherit(hooks1);
hooks2.lifecycle.a.emit();
```
npm package: @garfish/loader
Description: loader module.
Author: chentao.arthur <chentao.arthur@bytedance.com>
Latest version: 1.19.8

# `@garfish/loader`

[![NPM version](https://img.shields.io/npm/v/@garfish/loader.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/loader)

## Usage

```js
import { Loader } from '@garfish/loader';

const loader = new Loader({
  maxSize: 1024 * 1024 * 15, // default number is "1024 * 1024 * 15"
});

loader.hooks.usePlugin({
  name: 'test-plugin1',

  beforeLoad({ url, config }) {
    // You can changed the request config
    if (url.includes('xx')) {
      url = url.replace('xx', '');
    }
    return { url, config };
  },

  loaded(data) {
    const { result, value } = data;
    data.n = 1;
    return data;
  },
});

loader.hooks.usePlugin({
  name: 'test-plugin2',

  loaded(data) {
    console.log(data.n); // 1
    // The "data.value" will be cached this time.
    // So, you can transform the request result.
    return data;
  },
});

loader.load({scope: 'appName', url: 'https://xxx'}).then((result) => {
  console.log(result); // 2
});
```

## Clear cache

```js
const loader = new Loader();

loader.clear('appName'); // Clear all cached resources under "appName"
loader.clear('appName', 'js'); // Clear all "js" cache resources under "appName"

loader.clearAll(); // Clear all cached resources
loader.clearAll('css'); // Clear all "css" cached resources
```
npm package: @garfish/router
Description: router module.
Author: zhouxiao <codingzx@gmail.com>
Latest version: 1.19.8

# `@garfish/router`

[![NPM version](https://img.shields.io/npm/v/@garfish/router.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/router)

## Usage

```js
import router from '@garfish/router';

// TODO: DEMONSTRATE API
```