open-index/open-npm huggingface dataset:
npm package: @heise/embetty-base
Description: [Embetty](https://github.com/heiseonline/embetty) displays remote content like tweets or YouTube videos without compromising your privacy. `embetty-base` is the API used to retrieve the necessary data.
Latest version: 1.0.9

# embetty-base · [![Build Status](https://travis-ci.org/heiseonline/embetty-base.svg?branch=master)](https://travis-ci.org/heiseonline/embetty-base) [![Greenkeeper badge](https://badges.greenkeeper.io/heiseonline/embetty-base.svg)](https://greenkeeper.io/) [![Dependency Status](https://david-dm.org/heiseonline/embetty-base.svg)](https://david-dm.org/heiseonline/embetty-base) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

[Embetty](https://github.com/heiseonline/embetty) displays remote content like tweets or YouTube videos without compromising your privacy. `embetty-base` is the API used to retrieve the necessary data.

## Quick Start

### Install

```sh
$ npm install @heise/embetty-base
```

or

```sh
$ yarn add @heise/embetty-base
```

### Basic Usage

```js
const Embetty = require('@heise/embetty-base')

const embetty = new Embetty()
const tweet = await embetty.loadTweet(someStatusId)
```

### Using the cache

By default, remote service responses are stored in an LRU cache. The engine can be selected by defining the environment variable `EMBETTY_CACHE`. Example:

```sh
$ export EMBETTY_CACHE=redis://
```

## Running tests

```sh
$ yarn test
```

## Debug

You can set the `DEBUG` env to `embetty.*` to print debug info:

```sh
$ export DEBUG=embetty.*
```

## License

embetty-base is [MIT licensed](./LICENSE).
npm package: @heise/eslint-config
Description: The Heise eslint configuration.
Author: Philipp Busse
Latest version: 22.0.1

# @heise/eslint-config

The Heise eslint configuration.

```sh
$ cd my-project
$ yarn add --dev @heise/eslint-config # Or with npm
$ npm install --save-dev @heise/eslint-config
```

Edit `my-project/.eslintrc.js`:

```js
module.exports = {
  extends: '@heise',
  // Optional: Other configurations, for example:
  // parser: 'babel-eslint',
}
```
npm package: @heise/request-promise-native-record
Description: Records and plays back responses from remote web services so you can test your code in peace.
Author: Philipp Busse
Latest version: 1.0.13

# request-promise-native-record

[![Build Status](https://travis-ci.org/heiseonline/request-promise-native-record.svg?branch=master)](https://travis-ci.org/heiseonline/request-promise-native-record)
[![Greenkeeper badge](https://badges.greenkeeper.io/heiseonline/request-promise-native-record.svg)](https://greenkeeper.io/)
[![Dependency Status](https://img.shields.io/david/heiseonline/request-promise-native-record.svg?style=flat-square)](https://david-dm.org/heiseonline/request-promise-native-record)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

When writing unit tests for APIs that consume remote web services, your goal is to test your code, not the network or remote web service. `request-promise-native-record` records the answers of these web services and plays them back later.

If a recording does not exist or the environment variable `HTTP_MODE` is set to `record`, HTTP responses are written to files when running your tests. You may want to check these files into your VCS. If recordings are available, they will be used automatically for further test runs. No network traffic will occur from now on.

## Installation

```sh
yarn add --dev @heise/request-promise-native-record
```

or

```sh
npm install --save-dev @heise/request-promise-native-record
```

## Usage

`lib/my-api.js`:

```js
const request = require('request-promise-native')

class Api {
  static getFoo() {
    return request.get('http://example.com/')
  }
}

module.exports = Api
```

`test/my-api.js`:

```js
const assert = require('assert')
const record = require('@heise/request-promise-native-record')

record.start({folder: '/tmp'})
const Api = require('../lib/my-api')

describe('my description', () => {
  it('should test my api', async () => {
    let response = await Api.getFoo() // 1. call: network request
    let response = await Api.getFoo() // 2. call: read from fs
    assert.ok(response.includes('Example Domain'))
  })
})
```

Generated file:

```sh
$ cat /tmp/14ba12b98882bca3bc00abff8735175a2544a9c1aa64794e85503198d84595b5.json 
"<!doctype html>\n<html>\n<head>[...]"
```

## Storing/Retrieving response headers, status codes and response body

To save the full response instead of just the response body, use the option [`resolveWithFullResponse`](https://github.com/request/request-promise#get-the-full-response-instead-of-just-the-body). The `Authorization` header is removed from the headers object before writing to the hard disk.

`lib/my-api.js`:

```js
const request = require('request-promise-native')

class Api {
  static getFoo() {
    return request.get('http://example.com/', {resolveWithFullResponse: true})
  }
}

module.exports = Api
```

## Limitations

- Currently only `request-promise-native` is supported as HTTP lib.
- Currently only `request.get()` is supported.
- The generated files are stored flat in the specified directory. You may have to clean up the files by yourself.
npm package: @heisea/affix
Description: 固钉组件
Latest version: 0.0.2

# affix
将页面元素钉在可视范围。

## 更新说明

`v0.0.1`
1. init

## 兼容
+ chrome //谷歌
+ ie11 //IE
+ safari //mac safari
+ firefox // 火狐

## 目录说明

+ build 项目脚手架配置 
+ lib 生产用代码
+ src 源码
+ index.html demo

## 命令

进行开发
```bash
npm start
```

打包出生产版本 commonjs 版本
```bash
npm run build:common

``` 

### 发布代码

```bash
  npm version <newversion> | major | minor | patch]
```

```bash
 npm publish
```

## 安装

```bash
npm i @heisea/affix
```

## 初始化

```js

Vue.use(Affix);

```

## 使用
1.当组件使用
```html
<template>
     <bk-affix :offset-top="top" /></bk-affix>
</template>
<script>
export default {
    data() {
        return {
            top: 10
        };
    }
};
</script>

```

## 配置

属性名 | 类型 | 说明 | 默认值
--- | --- | --- | ---
offsetBottom | number | 距离窗口底部达到指定偏移量后触发
offsetTop | number | 距离窗口顶部达到指定偏移量后触发	
target | () => HTMLElement | 设置 Affix 需要监听其滚动事件的元素，值为一个返回对应 DOM 元素的函数 | () => HTMLElement

## 事件

事件名称 | 描述
--- | ---
change | 固定状态改变时触发的回调函数
npm package: @heisea/brick
Description: Vue solution for quickly building pages
Latest version: 0.22.2-beta.46

#### 项目说明
http://brick.udplat.com/about-brick

###

开发统一从`master`拉出分支进行开发
#### npm配置
##### 切换镜像地址，建议升级至 Nodejs 8.x, npm 5.x，建议使用nrm工具管理npm源
```bash
    npm config set registry http://nexus.heisea.cn/nexus/content/groups/npm-all/

```

#### 发包流程

###### 1.修改注册仓库（已切换的可以忽略）

```bash
    npm config set registry http://nexus.heisea.cn/nexus/content/groups/npm-all/
```

###### 2.添加用户，用户名密码是OA账号
```bash
    npm adduser
    npm login
```

###### 3.发布前必须修改版本号
```bash
    <!-- 版本号说明 -->
    # major 大版本升级，不向下兼容
    # minor 增加新功能
    # patch 修订，bug 修复
    npm version [<newversion> | major | minor | patch]
```

###### 4.发包（注意：npm 包需要保持相当高的可用性、稳定性，不允许随意发包，发包前需通过单元测试、业务测试）
```bash
    npm publish
```
npm package: @heisea/brick-bj
Description: Vue solution for quickly building pages
Latest version: 0.0.11

#### 项目说明
http://brick.udplat.com/about-brick
#### npm配置
##### 切换镜像地址，建议升级至 Nodejs 8.x, npm 5.x，建议使用nrm工具管理npm源
```bash
    npm config set registry http://nexus.heisea.cn/nexus/content/groups/npm-all/

```

#### 发包流程

###### 1.修改注册仓库（已切换的可以忽略）

```bash
    npm config set registry http://nexus.heisea.cn/nexus/content/groups/npm-all/
```

###### 2.添加用户，用户名密码是OA账号
```bash
    npm adduser
    npm login
```

###### 3.发布前必须修改版本号
```bash
    <!-- 版本号说明 -->
    # major 大版本升级，不向下兼容
    # minor 增加新功能
    # patch 修订，bug 修复
    npm version [<newversion> | major | minor | patch]
```

###### 4.发包（注意：npm 包需要保持相当高的可用性、稳定性，不允许随意发包，发包前需通过单元测试、业务测试）
```bash
    npm publish
```
npm package: @heisea/err-log
Description: 错误上报
Latest version: 0.0.4

# err-log

错误上报

## 更新记录
`v0.0.4`
1. 请求方式修改为img方式，解决跨域问题，减小插件体积

`v0.0.3`
1. 调整上报接口

`v0.0.2`
1. 优化配置

`v0.0.1`
1. 错误上报mvp版本


## 命令
#### 进行开发
````bash
npm start

````
#### 打包出生产版本 commonjs 版本
````bash
npm run build:common
````

#### 打包出生产版本 在html可引入的版本
```bash
npm run build:var
```

#### 发布代码 <newversion> | major | minor | patch]
````bash
npm publish
````
 
 ## 安装

````bash
npm i @heisea/err-log
````

## 使用

1、es6引入方式
```js
import ErrLog from '@heisea/err-log'
```

2、初始化
```js
Vue.use(ErrLog, {
    project: `${process.env.NODE_ENV}-{{projectName}}`,
    api: '/hxEventTracking/fe/log'
});
```

## 配置说明

属性名 | 类型 | 说明
--- | --- | ---
project | Object | 项目名
api | String | 上报地址

## 查看日志

```bash
http://172.18.30.152:5601/app/kibana#/home
账号：elastic
密码：a1nkWC4f7MISV9zfsBZu
```
npm package: @heisea/viewer
Description: Vue solution for quickly building pages
Latest version: 0.2.12

# viewer
基于vue2的资源预览控件，支持放大、缩小、旋转、拖拽，支持远程图片预览、调起下载、打印，支持多图预览。

## 更新说明
`v0.2.9`
1. 优化：添加了请求错误打印

`v0.2.8`
1. 修复： 图片文件后缀为大写时识别成文件id

`v0.2.6`
1. 修复： node_modules下pdfjs-dist 插件源码不支持电子签章预览的bug，新增一个`patch-package`依赖包。

`v0.2.5`
1. 修复：图片预览正则出错
2. 新增：options支持传入fetch方法

`v0.2.4`
1. 修复：PDF预览发票内容显示不全
2. 优化：Esc关闭预览，禁止事件冒泡

`v0.2.3`
1. 修复：PDF预览不需要`@heisea/viewer/lib/vendors~pdfjsWorker.common.js`

`v0.2.2`
1. 优化：错误提示
2. 优化：图片判断正则

`v0.2.1`
1. 修复：PDF预览必须`@heisea/viewer/lib/vendors~pdfjsWorker.common.js`
1. 优化:允许在绑定到全局时传人参数`vue.use(Viewer,options)`,单独使用组件时不生效。

`v0.2.0`
1. 新增 ***pdf-viewer*** pdf预览组件支持支持函数预览

`v0.1.1`
1. 修改下载方法，目前只保留模拟a下载的逻辑
1. 新增`downloadFN`允许自定义下载方法

`v0.1.0`
1. 图片预览控件

## 兼容
+ chrome //谷歌
+ ie11 //IE
+ safari //mac safari
+ firefox // 火狐

## 目录说明

+ build 项目脚手架配置 
+ lib 生产用代码
+ src 源码
+ index.html demo

## 命令

进行开发
```bash
npm start
```

打包出生产版本 commonjs 版本
```bash
npm run build:common

``` 

### 发布代码

```bash
  npm version <newversion> | major | minor | patch]
```

```bash
 npm publish
```

## 安装

```bash
npm i @heisea/viewer
```

## 初始化

```js

import Viewer from '@heisea/viewer'
Vue.use(Viewer,{
    props: {
        fileId: 'id',
        fileName: 'originalFileName',
        fileSuffix: 'ext',
        fileUrl: 'url',
        data: 'data'
    },
    http: {
        filePath: 'http://hxgw.heisea.cn/base/fe/info'
    },
    fetch
}); // 当前组件
Vue.prototype.$fetch = fetch; // 当传参数时会调用当前获得文件

```

注意pdf预览，必须设置拷贝字体资源文件夹cmaps 到根目录
```js
new CopyWebpackPlugin({
        patterns: [
            {
                from: path.resolve(__dirname, '../node_modules/@heisea/viewer/lib/cmaps/'),
                to: path.resolve(__dirname, '../dist/cmaps/')
            }]
    }),

```

## 使用
1.当组件使用
```js
<template>
     <img-viewer v-bind="cfg" />
</template>
<script>
export default {
    data() {
        return {
            cfg: {
                mode: 'img',
                value: 'http://bucket-cert-test.oss-cn-shanghai.aliyuncs.com/2019/10/51df3ed3-fa5f-4334-9963-6767fe63aa06.jpg'
            },
        };
    }
};
</script>

```
2.函数调用 this.$viewer({value:url,options})
支持单独配置配置当前预览器
```js
    // 直接打开图片
    this.$viewer('http://bucket-cert-test.oss-cn-shanghai.aliyuncs.com/2019/10/51df3ed3-fa5f-4334-9963-6767fe63aa06.jpg');
    // 直接打开id对应的资源
    this.$viewer('1182133098524016641,1182222336212881410');
```

## 配置

属性名 | 类型 | 说明
--- | --- | --- 
mode|String|显示状态`node:不显示，btn:按钮，img:图片`
value|Auto|显示的内容`object:作为资源对象，Array:多个资源对象，String：资源地址（支持用‘,’分割多个）`
btnLabel|String、Function|`mode:btn`时使用修改显示内容，默认：“查看文件”,同时支持直接
http | Object | 请求配置，必须配置`$fetch`
http.filePath | String | 文件请求地址
props| Object | 配置字段
extend | Object | 站位节点属性配置
downloadFN | Function | 自定义资源下载逻辑（url,fileName）
npm package: @heisee/letsclarify-mcp
Description: MCP server for LetsClarify — Human-in-the-Loop API for AI agents
Author: heisee
Latest version: 1.0.4

# @heisee/letsclarify-mcp

MCP server for [LetsClarify](https://letsclarify.ai) — Human-in-the-Loop API for AI agents.

Create structured forms via API, share URLs with humans, get JSON back.

## Setup

```json
{
  "mcpServers": {
    "letsclarify": {
      "command": "npx",
      "args": ["-y", "@heisee/letsclarify-mcp"],
      "env": {
        "LETSCLARIFY_API_KEY": "lc_your_key_here"
      }
    }
  }
}
```

## Tools

| Tool | Description |
|------|-------------|
| `create_form` | Create a form with schema, title, context, recipients |
| `get_form_summary` | Quick overview: submitted/pending counts |
| `get_form_results` | Paginated results with filters and file support |
| `delete_form` | Permanently delete a form and all its data |
| `add_recipients` | Add more recipient slots to an existing form |

## Resources

| URI | Description |
|-----|-------------|
| `letsclarify://schema-dsl` | Schema DSL reference (field types, validation, file config) |

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `LETSCLARIFY_API_KEY` | Yes | API key (starts with `lc_`) |
| `LETSCLARIFY_BASE_URL` | No | Override base URL (default: `https://letsclarify.ai`) |

## License

MIT
npm package: @heisenware/luxafor-agent
Description: Luxafor Agent
Author: Heisenware GmbH
Latest version: 0.1.1

# Luxafor Agent

Provides access to luxafor devices

## Starting instructions

### Linux

The Luxafor agent must have the rights to access the USB port.

Under Linux you can achieve that by starting the application using `sudo`.
Note that you have to provide the absolute path to the executable in that case.

You can find out the path using:

```bash
which node
```

Example:

```bash
sudo /home/bheisen/.nvm/versions/node/v16.15.1/bin/node index.js -a 'Luxafor Agent' -d <domain>
```

You can then try out your device using [vrpc.io](https://live.vrpc.io)

Hint:

Depending on your OS the `node-hid` library may needs to be build and can not
survive with the pre-packed binaries. If that's the case install this package with

```bash
npm install --build-from-source
```

### Windows

Make sure you have installed node, that's all you need!

```bash
node index.js - a 'Luxafor Agent' -d <domain>
```

## Integration to Heisenware's App Builder

Example:

```bash
node index.js -a 'Luxafor Agent' -d <domain> -t <token> -b mqtts://heisenware.rocks --bestEffort
```

You will then see the device directly in the Connectivity list.
npm package: @heishi/config
Description: Config helper library for node.
Author: Daniel Wang
Latest version: 1.0.1

# Config
Config helper library for node.

## Usage
All usages are same as `config` module.

```javascript
const config = require('@heishi/config')
```

In production, place your config and secret files under:     
`/var/config.yaml` and `/var/secret.yaml`
npm package: @heisian/cocoadialog
Description: Node.js wrapper for cocoaDialog
Author: Mark Carver
Latest version: 0.0.0-development

# cocoadialog

> Node.js wrapper for [cocoaDialog]

**Note:** Issues with the actual cocoaDialog application should be filed in its [issue queue](https://github.com/mstratman/cocoadialog/issues).


## Install

```
$ npm install --save cocoadialog
```


## Basic Usage

```js
const cocoaDialog = require('cocoadialog').setGlobalOption({
  stringOutput: true
});

cocoaDialog.msgBox()
  .setTitle('This is the title')
  .setIcon('caution')
  .setLabel('This is the label')
  .setButtons('Ok', 'Cancel', 'More')
  .open()
  .then(result => {
    if (result.button === 'Ok') {
      console.log('Ok button was clicked.');
    }
    else if (result.button === 'More') {
      console.log('More button was clicked.');
    }
  })
  .catch(result => {
    if (result.hasAborted()) {
      console.log('Cancel button was clicked.');
    }
    else {
      console.error(result.error);
    }
  });
```

## Examples

* [MsgBox](https://unicorn-fail.github.io/node-cocoadialog/?content=msgbox)
* [ProgressBar](https://unicorn-fail.github.io/node-cocoadialog//?content=progressbar)


## API

[API Documentation](https://unicorn-fail.github.io/node-cocoadialog/?api)

## License

MIT © [Mark Carver](https://github.com/markcarver)

[cocoaDialog]: http://mstratman.github.io/cocoadialog/#documentation3.0
npm package: @heisian/knex
Description: A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser
Author: Tim Griesser
Latest version: 0.15.4

# [knex.js](http://knexjs.org)

[![npm version](http://img.shields.io/npm/v/knex.svg)](https://npmjs.org/package/knex)
[![Build Status](https://travis-ci.org/tgriesser/knex.svg?branch=master)](https://travis-ci.org/tgriesser/knex)
[![Coverage Status](https://coveralls.io/repos/tgriesser/knex/badge.svg?branch=master)](https://coveralls.io/r/tgriesser/knex?branch=master)
[![Dependencies Status](https://david-dm.org/tgriesser/knex.svg)](https://david-dm.org/tgriesser/knex)
[![Gitter chat](https://badges.gitter.im/tgriesser/knex.svg)](https://gitter.im/tgriesser/knex)

> **A SQL query builder that is _flexible_, _portable_, and _fun_ to use!**

A batteries-included, multi-dialect (MSSQL, MySQL, PostgreSQL, SQLite3, Oracle(including Oracle Wallet Authentication)) query builder for
Node.js and the Browser, featuring:

- [transactions](http://knexjs.org/#Transactions)
- [connection pooling](http://knexjs.org/#Installation-pooling)
- [streaming queries](http://knexjs.org/#Interfaces-Streams)
- both a [promise](http://knexjs.org/#Interfaces-Promises) and [callback](http://knexjs.org/#Interfaces-Callbacks) API
- a [thorough test suite](https://travis-ci.org/tgriesser/knex)
- the ability to [run in the Browser](http://knexjs.org/#Installation-browser)

Node.js versions 6+ are supported.

[Read the full documentation to get started!](http://knexjs.org)

For support and questions, join the `#bookshelf` channel on freenode IRC

For an Object Relational Mapper, see:
- http://bookshelfjs.org
- https://github.com/Vincit/objection.js

To see the SQL that Knex will generate for a given query, see: [Knex Query Lab](http://michaelavila.com/knex-querylab/)

## Examples

We have several examples [on the website](http://knexjs.org). Here is the first one to get you started:

```js
var knex = require('knex')({
  dialect: 'sqlite3',
  connection: {
    filename: './data.db'
  }
});

// Create a table
knex.schema.createTable('users', function(table) {
  table.increments('id');
  table.string('user_name');
})

// ...and another
.createTable('accounts', function(table) {
  table.increments('id');
  table.string('account_name');
  table.integer('user_id').unsigned().references('users.id');
})

// Then query the table...
.then(function() {
  return knex.insert({user_name: 'Tim'}).into('users');
})

// ...and using the insert id, insert into the other table.
.then(function(rows) {
  return knex.table('accounts').insert({account_name: 'knex', user_id: rows[0]});
})

// Query both of the rows.
.then(function() {
  return knex('users')
    .join('accounts', 'users.id', 'accounts.user_id')
    .select('users.user_name as user', 'accounts.account_name as account');
})

// .map over the results
.map(function(row) {
  console.log(row);
})

// Finally, add a .catch handler for the promise chain
.catch(function(e) {
  console.error(e);
});
```
npm package: @heisian/sequelize-cli
Description: The Sequelize CLI
Author: Sascha Depold
Latest version: 4.0.6

# sequelize/cli [![npm version](https://badge.fury.io/js/sequelize-cli.svg)](https://badge.fury.io/js/sequelize-cli) [![Build Status](https://travis-ci.org/sequelize/cli.svg?branch=master)](https://travis-ci.org/sequelize/cli) [![Greenkeeper badge](https://badges.greenkeeper.io/sequelize/cli.svg)](https://greenkeeper.io/)

The Sequelize Command Line Interface (CLI)

## Table of Contents
- [Installation](#installation)
- [Contributing](#contributing)
- [Sequelize Support](#sequelize-support)
- [Documentation](#documentation)

## Installation

### Globally
Install CLI globally with

```bash
$ npm install -g sequelize-cli
```

Now you can run CLI using following command anywhere

```bash
$ sequelize
```

### Locally
Install CLI locally to your `node_modules` folder with

```bash
$ npm install --save sequelize-cli
```

You should be able to run CLI with

```bash
$ node_modules/.bin/sequelize
```

### Usage
```
Sequelize CLI [Node: 6.11.2, CLI: 3.0.0, ORM: 4.8.0]

Commands:
  db:migrate                        Run pending migrations
  db:migrate:schema:timestamps:add  Update migration table to have timestamps
  db:migrate:status                 List the status of all migrations
  db:migrate:undo                   Reverts a migration
  db:migrate:undo:all               Revert all migrations ran
  db:seed                           Run specified seeder
  db:seed:undo                      Deletes data from the database
  db:seed:all                       Run every seeder
  db:seed:undo:all                  Deletes data from the database
  db:create                         Create database specified by configuration
  db:drop                           Drop database specified by configuration
  init                              Initializes project
  init:config                       Initializes configuration
  init:migrations                   Initializes migrations
  init:models                       Initializes models
  init:seeders                      Initializes seeders
  migration:generate                Generates a new migration file       [aliases: migration:create]
  model:generate                    Generates a model and its migration  [aliases: model:create]
  seed:generate                     Generates a new seed file            [aliases: seed:create]

Options:
  --version  Show version number                                         [boolean]
  --help     Show help                                                   [boolean]
```

## Contributing

Sequelize CLI is always looking for contributions. You can help us with fixing bugs, reporting bugs or improving documentation.

Please read [contributing documentation](CONTRIBUTING.md)

## Documentation

- [Migrations Documentation](http://docs.sequelizejs.com/manual/tutorial/migrations.html)
- [CLI Options](docs/README.md)
- [Frequently Asked Questions](docs/FAQ.md)
npm package: @heiwa4126/cow1
Description: A TypeScript wrapper for cowsay with dual-package (ESM/CJS) support and CLI functionality. Generate ASCII art of a cow saying your custom message.
Author: heiwa4126
Latest version: 0.0.1

# heiwa4126-cow1 (@heiwa4126/cow1)

[![npm version](https://img.shields.io/npm/v/@heiwa4126/cow1.svg)](https://www.npmjs.com/package/@heiwa4126/cow1)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Node.js](https://img.shields.io/badge/Node.js-18%2B-green.svg)](https://nodejs.org/)

TypeScript でパッケージ書いて
EMS と CJS にするプロジェクトの練習。主に外部依存のテスト

中身は
[cowsay - npm](https://www.npmjs.com/package/cowsay#usage-as-a-module)
をラップしただけで意味は無い。

## インストール

```sh
npm install @heiwa4126/cow1
```

## 実行例

```console
$ heiwa4126-cow1 'There is nothing either good or bad,\nbut thinking makes it so.'
 ______________________________________
/ There is nothing either good or bad, \
\ but thinking makes it so.            /
 --------------------------------------
        \   ^__^
         \  (oO)\_______
            (__)\       )\/\
             U  ||----w |
                ||     ||
```

(開発ディレクリ内では `npx heiwa4126-cow1` のように実行しましょう)

## API

### `cow(text?: string): string`

指定されたテキストを牛が話す ASCII アートを生成します。

#### パラメータ

- `text` (optional): 牛に話させるテキスト。省略した場合は `"I'm a moooodule"` がデフォルト値として使用されます。

#### 戻り値

- `string`: 牛の ASCII アートとメッセージを含む文字列

#### 使用例

```typescript
import { cow } from "@heiwa4126/cow1";

// デフォルトメッセージ
console.log(cow());

// カスタムメッセージ
console.log(cow("Hello, TypeScript!"));

// マルチラインメッセージ
console.log(cow("Line 1\nLine 2\nLine 3"));
```

### ESM / CommonJS サポート

このパッケージは ESM と CommonJS の両方をサポートしています:

```javascript
// ESM
import { cow } from "@heiwa4126/cow1";

// CommonJS
const { cow } = require("@heiwa4126/cow1");
```

### CLI 使用方法

パッケージをインストールすると、`heiwa4126-cow1` コマンドが利用可能になります:

```bash
# デフォルトメッセージ
heiwa4126-cow1

# カスタムメッセージ
heiwa4126-cow1 "Your message here"

# マルチライン(\nが実際の改行に変換されます)
heiwa4126-cow1 'Line 1\nLine 2'
```

## 開発

はじめかた

```sh
npm run init  # `npm init` ではない
npm run smoketest
```
npm package: @heiwa4126/fizzbuzz
Description: NPM package tutorial
Author: heiwa4126
Latest version: 1.1.1

# npm-fizzbuzz (@heiwa4126/fizzbuzz)

npm パッケージの練習。最初は CommonJS のみで始める。

[Fizz Buzz](https://ja.wikipedia.org/wiki/Fizz_Buzz)のジェネレーター。

## インストール

```sh
npm install @heiwa4126/fizzbuzz
```

CLI として `heiwa4126-fizzbuzz` がインストールされる。

## 使用例

```javascript
const { fizzbuzz } = require("@heiwa4126/fizzbuzz");

for (const i of fizzbuzz(15)) {
  console.log(i);
}
```

output:

```text
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
```

または

```sh
npx @heiwa4126/fizzbuzz 15
# or
heiwa4126-fizzbuzz 15
```

## 開発メモ

ソースには run-scripts に

- `npm test` - [tape](https://www.npmjs.com/package/tape) によるテスト
- `npm run lint` - [biome](https://www.npmjs.com/package/@biomejs/biome) による lint
- `npm run fix` - biome による [安全な修正(Safe fixes)](https://biomejs.dev/ja/linter/#%E5%AE%89%E5%85%A8%E3%81%AA%E4%BF%AE%E6%AD%A3safe-fixes)
- `npm run lint:package` - [npm-package-json-lint](https://www.npmjs.com/package/npm-package-json-lint) による package.json の lint
- `npm run linklocal` - 自分自身のリンクを node_modules の下に作る。Python の editable mode (`pip install -e`) に相当する。多分 Linux でしか動かない

が書いてあります。

レポジトリからクローンしたら

```sh
npm i
npm run linklocal  # オプション
```

で始めて作業してください。

また数字のみの git タグ(例:"v1.0.0","v1.0.0-0"など)をつけて、
main ブランチを
GitHub に `git push --tags` すると
GitHub Packages が生成される
GitHub Actions が書いてあります
([release-package.yml](.github/workflows/release-package.yml))。

GitHub Packages については
[GitHub Packages のクイックスタート - GitHub Docs](https://docs.github.com/ja/packages/quickstart)
を参照してください。