open-index/open-npm huggingface dataset:
npm package: @mammut-fe/nejm
Description: 方便在nej中使用es6
Author: lleohao
Latest version: 1.1.0

# NEJM

使用`babel`转化`nej`的代码为`commonjs`规范, 解决其中`this`指向`window`和依赖问题

## 实现原理

1. 将`define`函数中的依赖调整成相对路径导入
2. 将`NEJ`注入的`_p, _o, _f, _r`变量在文件前声明
3. 将`define`中直接使用的`this`变量指向`window`
4. 使用`export default`导出`define`函数的内容
5. 删除了全局变量`CMPT`和`DEBUG`相关代码
6. 删除了 patch 的支持

**由于第五点和第六点的变更, 所以不支持低版本的浏览器(也不打算支持)**

> 由于`NEJ`中存在飘忽不定的`this`指向问题, 部分`this`通过更改源码来指向`window`
>
> [变更日志](https://github.com/Mammut-FE/nejm/blob/master/src/nejRoot/CHANGELOG.md)
>
> 若发现其他文件存在`this`指向问题, 可以提`issue`或`pr`修复

## 安装

`npm i nejm --save`

## 使用

```javascript
import element from 'nejm/base/element';
import utilAjaxXdr from 'nejm/util/ajax/xhr';

utilAjaxXdr._$request({
    method: 'post',
    data: {
		param: "data"
    },
    success: function (res) {
        const showElement = element._$get('box');
        showElement.innerHTML = res.message;
    }
});
```
npm package: @mamoplayer/core
Description: Core React Native video player package for the MamoPlayer SDK
Author: MamoPlayer
Latest version: 1.0.0-rc.1

# @mamoplayer/core

Core React Native video player package for the MamoPlayer SDK.

## Installation

```sh
npm install @mamoplayer/core
# or
yarn add @mamoplayer/core
```

## Peer Dependencies

This package requires the following peer dependencies:

- `react` >=18
- `react-native` >=0.72
- `react-native-video` >=6

Please install them if they are not already in your project.

## Usage

```tsx
import MamoPlayer from '@mamoplayer/core';

<MamoPlayer
  source={{ uri: 'https://example.com/video.mp4' }}
/>
```

## License

MIT
npm package: @mamoru-ai/mamoru-sdk-as
Description: AssemblyScript SDK for Mamoru Daemons
Author: Mamoru AI
Latest version: 0.9.0

## AssemblyScript SDK for Mamoru Daemons

This is an SDK for interacting with Mamoru from AssemblyScript.

### Installation

You can install this package via npm:

```bash
npm install @mamoru-ai/mamoru-sdk-as
```

### Usage

Here is an example Mamoru Daemon that uses the SDK:

```typescript
import { http, HttpMethod, report, IncidentSeverity, query } from '@mamoru-ai/mamoru-sdk-as/assembly';

export function main(): void {
    const response = http(
        HttpMethod.GET,
        'https://example.com',
        );

    const error = response.error();

    if (error != null) {
        // Handle the error
    } else {
        const body = response.body();
        if (body) {
            // Do something with the response body
            report(IncidentSeverity.Info, "Response body received");
        }
    }

    query('SELECT * FROM transactions').forEach((tx) => {
        const hash = tx.getString!("hash")!.valueOf();

        if (hash == "0x0") {
           report(IncidentSeverity.Info, "Hash is 0x0");
        }
    });
}
```

The SDK offers these functions:

```typescript
/**
 * Performs HTTP request to a remote host
 * 
 * @returns {HttpResponse} The response or an error
 *
 * @example
 * let response = http(HttpMethod.GET, "https://example.com/");
 * if (response.status() == 200) {
 *     //
 * }
 */
http(
    method: HttpMethod,
    url: string,
    headers: Map<string, string> | null = null,
    body: string | null = null,
): HttpResponse;

/**
 * Queries the daemon context.
 * @param query Valid SQL query for the network.
 *
 * @return {Array<JSON.Obj>} Object keys are the fields returned by the query.
 *
 * @example
 * let rows = query("SELECT t.gas_used FROM transactions t WHERE t.digest = 'DUMMY_HASH'");
 *
 * rows.forEach(value => {
 *     let gas_used = value.getInteger("gas_used")!.valueOf();
 * 
 *     if (gas_used == 42_000) {
 *         // handle value
 *     }
 * });
 */
query(query: string): Array<JSON.Obj>;

/**
 * Reports an incident to Validation Chain.
 *
 * @example
 * let data = new IncidentDataStruct();
 *
 * data.addNull("null");
 * data.addNumber("number", 42.0);
 * data.addString("string", "hello");
 * data.addBoolean("boolean", true);
 * data.addList("list", [
 *     new StringDataValue("first"),
 *     new StringDataValue("second"),
 * ]);
 *
 * report(IncidentSeverity.Alert, "Test", data);
 */
report(
    severity: IncidentSeverity,
    message: string,
    data: IncidentDataStruct | null = null,
    address: string = "",
): void;

/**
 * Retrieve a parameter value from the daemon configuration.
 *
 * @returns {DaemonParameter}
 *
 * @example
 * let param = parameter("foo");
 * let maybe_bool = param.asBoolean();
 * let maybe_number = param.asNumber();
 * let str = param.asString();
 */
parameter(key: string): DaemonParameter;
```

### License

This SDK is licensed under the MIT License.
npm package: @mamoruds/cap
Description: Simple cli arguments parser written in typescript for node/deno
Author: MamoruDS
Latest version: 0.1.1

# cap

Simple cli arguments parser written in TypesScript for node/Deno

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

## Installation

### nodejs

```shell
npm i @mamoruds/cap
```

### Deno

```typescript
import { Cap } from 'https://deno.land/x/cap/cap-deno.ts'
```

## Usage

```typescript
import { Cap } from '@mamoruds/cap'

const cap = new Cap({
    name: {
        alias: 'n',
        type: 'string',
        optional: false,
        about: 'some description about field "name"',
    },
    age: {
        type: 'string',
        optional: true,
        about: 'some description about field "age"',
    },
    silent: {
        alias: 's',
        type: 'boolean',
        optional: true,
        default: true,
        about: 'enable/disable silent',
    },
})
    .about('cap-js-example-node')
    .parse(process.argv.slice(2))

console.log(cap)

// $ node script.js -n mamoru --no-silent
// or using Deno
// $ deno run script.js -n mamoru --no-silent
// output
// { name: 'mamoru', silent: false, age: undefined }
```

## License

MIT © MamoruDS