open-index/open-npm huggingface dataset:
npm package: @mider-solutions/chart-js-big-data
Description: Efficient plotting of large timeseries data, based on Chart.js backend
Latest version: 0.1.0

# chart-js-big-data

Efficient plotting of large timeseries data, based on [Chart.js](https://www.chartjs.org/) backend

## Installation

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.1.33. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
npm package: @midesweb/dile-button
Description: A simple button
Latest version: 2.0.4

# \<dile-button\>

Polymer Web Component to implement a simple animated button

This components accepts a "role" property to styling.
Also a boolean property called "disabled" to disable the button.

Clicks on the button produces a CSS animation, when the button disabled property is false.

```html
<dile-button
  role="primary"
  disabled
></dile-button>
```

Custom property | Description | Default
----------------|-------------|---------
--dile-button-padding | Padding applied to the buttton box | 10px
--dile-button-box | Mixind applied to the button box | {}
npm package: @midevils/soulburn
Description: JavaScript client for the Soulburn program
Latest version: 0.0.5

# JavaScript client

A generated JavaScript library for the Soulburn program.

## Getting started

To build and test your JavaScript client from the root of the repository, you may use the following command.

```sh
pnpm clients:js:test
```

This will start a new local validator, if one is not already running, and run the tests for your JavaScript client.

## Available client scripts.

Alternatively, you can go into the client directory and run the tests directly.

```sh
# Build your programs and start the validator.
pnpm programs:build
pnpm validator:restart

# Go into the client directory and run the tests.
cd clients/js
pnpm install
pnpm build
pnpm test
```

You may also use the following scripts to lint and/or format your JavaScript client.

```sh
pnpm lint
pnpm lint:fix
pnpm format
pnpm format:fix
```
npm package: @midevils/swap
Description: JavaScript client for the FloorSwap program
Latest version: 0.0.2

# JavaScript client

A generated JavaScript library for the Swap program.

## Getting started

To build and test your JavaScript client from the root of the repository, you may use the following command.

```sh
pnpm clients:js:test
```

This will start a new local validator, if one is not already running, and run the tests for your JavaScript client.

## Available client scripts.

Alternatively, you can go into the client directory and run the tests directly.

```sh
# Build your programs and start the validator.
pnpm programs:build
pnpm validator:restart

# Go into the client directory and run the tests.
cd clients/js
pnpm install
pnpm build
pnpm test
```

You may also use the following scripts to lint and/or format your JavaScript client.

```sh
pnpm lint
pnpm lint:fix
pnpm format
pnpm format:fix
```
npm package: @midgar/apollo-server
Description: A Midgar plugin to add graphql server
Author: Metais Fabien
Latest version: 1.0.0-alpha.1.3
Deprecated: New package: @midgar/graphql-server

[![Build Status](https://drone.midgar.io/api/badges/Midgar/apollo-server/status.svg)](https://drone.midgar.io/Midgar/apollo-server)
[![Coverage](https://sonar.midgar.io/api/project_badges/measure?project=Midgar%3Aapollo-server&metric=coverage)](https://sonar.midgar.io/dashboard?id=Midgar%3Aapollo-server)

# @midgar/apollo-server

PLugin [Midgar](https://github.com/midgarjs/midgar) pour ajouter un service [Apollo serveur](https://www.apollographql.com) avec loader de modules graphql et injéction de services.

## Installation

```sh
$ npm i @midgar/apollo-server --save
```

Si tout s'est bien passé, un message de confirmation s'affiche:
```
#midgar-cli
@midgar/apollo-server added to plugins.js !
```

## Fonctionnement
Ajoute un dossier de plugin **midgar-graphql**: ./graphql/ pour les modules graphl.

## module grapql
Un module graphql est un fichier javacript exportant les typeDefs et les resolvers graphql.

Exemple d'un module graphl:
```js
import { gql } from 'apollo-server-express'

// Type defs graphql
const typeDefs = gql`
  type User {
    id: ID!
    email: String!
  }

  extend type Query {
    addUser(email: String): User
    getUsers: [User]
  }
`

export default {
  // Services à incjecter
  dependencies: ['mid:user']
  graphql: (mid, userService) => {
    return {
      typeDefs,
      resolvers:{
        User: {
        ...
        }
        Query: {
          createUser: async (parent, args, ctx, info) => {
            await userService.create(args.email, args.parssword)
          },
          getUsers: (parent, args, ctx, info) => {
            ...
          },
        }
      }
    }
  }
}
```
Vous pouvez séparrer le fichier si besoin:


```js
import typeDefs from './user.typedefs'
import resolvers from './user.resolvers'

export default {
  dependencies: ['mid:user']
  graphql: (...args) => {
    return {
      typeDefs,
      resolvers: () => resolvers(...args)
    }
  }
}
```

Les fichiers *.typedefs.js et *.resolvers.js ne sont pas importé lors de l'import des modules graphql.
npm package: @midgar/controller
Description: A Migdar plugin to load controller
Author: Metais Fabien
Latest version: 1.0.0-alpha.1.4

[![Build Status](https://drone.midgar.io/api/badges/Midgar/controller/status.svg)](https://drone.midgar.io/Midgar/controller)
[![Coverage](https://sonar.midgar.io/api/project_badges/measure?project=midgar-controller&metric=coverage)](https://sonar.midgar.io/dashboard?id=midgar-controller)


## @midgar/controller

Plugin [Midgar](https://github.com/midgarjs/midgar) pour la gestion des controllers

## Installation

```sh
$ npm i @midgar/controller
```

Si tout s'est bien passé, un message de confirmation s'affiche:
```sh
#midgar-cli
@midgar/controller added to plugins.json !
```

## Fonctionnement
Ce plugin ajoute un type de module **midgar-controller** dans le dossier ./controllers/

Il suffit d'ajouter un controller dans le dossier ./controllers de votre plugin pour qu'il soit automatiquement importé au lancement de l'application et injecté dans express.

## Exemple de controller

```js
import { Controller } from '@midgar/controller' 

// Tableau de service a injécter
// @see: https://github.com/midgarjs/service
const dependencies = [
  'mid:user'
]

class UserController extends Controller {
  // Les dépendances sont injécté dans le contructeur
  constructor (mid, userService) {
    super(mid)
    this.prefix = 'user'
    this.userService = userService
  }

  /**
   * Cette méthod est appelé automatiquement
   * lors de l'instanciation du controller.
   */
  init () {
    this.addRoutes([
      {
        path: 'login',
        action: (...args) => this.login(...args)
      },      
      {
        method: 'post',
        path: 'login',
        action: (...args) => this.loginPost(...args)
      },
      {
        path: 'register',
        action: (...args) => this.register(...args)
      },
      {
        path: '/',
        action: (...args) => this.users(...args)
      }
    ])
  }

  // GET /user/login route
  async login (req, res) {
    if (await this.userService.login(req.getParam('login'), req.getParam('password', false))) {
      res.send({ success: true })
    } else {
      res.send({ success: false })
    }
  }

  // POST /user/login route
  loginPost (req, res) {}
  
  // GET /user/register route
  register (req, res) {}

  // GET /user route
  user (req, res) {}
}

export default {
  dependencies,
  controller: UserController
}
```
Les methodes terminant par Route, GetRoute, PostRoute, AllRoute sont automatiquement transformer en routes.
[documentation Api](https://midgarjs.github.io/controller/).
npm package: @midgar/graphql-server
Description: A Midgar plugin to add graphql server
Author: Metais Fabien
Latest version: 1.0.0-alpha.1.1

[![Build Status](https://drone.midgar.io/api/badges/Midgar/graphql-server/status.svg)](https://drone.midgar.io/Midgar/graphql-server)
[![Coverage](https://sonar.midgar.io/api/project_badges/measure?project=midgar-apollo-server&metric=coverage)](https://sonar.midgar.io/dashboard?id=midgar-apollo-server)

# @midgar/graphql-server

PLugin [Midgar](https://github.com/midgarjs/midgar) pour ajouter un [serveur graphql](https://www.apollographql.com) avec loader de modules graphql et injéction de services.

## Installation

```sh
$ npm i @midgar/graphql-server
```

Si tout s'est bien passé, un message de confirmation s'affiche:
```
#midgar-cli
@midgar/graphql-server added to plugins.json !
```

## Fonctionnement
Ce plugin ajoute un type de module **midgar-graphql** dans le dossier ./graphql/.

## module grapql
Exemple de module graphl:
```js
import { gql } from 'apollo-server-express'

// Type defs graphql
const typeDefs = gql`
  type User {
    id: ID!
    email: String!
  }

  extend type Query {
    addUser(email: String): User
    getUsers: [User]
  }
`

export default {
  // Services à incjecter
  dependencies: ['mid:user']
  graphql: (mid, userService) => {
    return {
      typeDefs,
      resolvers:{
        User: {
        ...
        }
        Query: {
          createUser: async (parent, args, ctx, info) => {
            await userService.create(args.email, args.parssword)
          },
          getUsers: (parent, args, ctx, info) => {
            ...
          },
        }
      }
    }
  }
}
```

Vous pouvez séparrer le fichier si besoin:

```js
import typeDefs from './user.typedefs'
import resolvers from './user.resolvers'

export default {
  dependencies: ['mid:user']
  graphql: (...args) => {
    return {
      typeDefs,
      resolvers: () => resolvers(...args)
    }
  }
}
```

Les fichiers *.typedefs.js et *.resolvers.js ne sont pas importé lors de l'import des modules graphql.
npm package: @midgar/mongo
Description: A Midgar plugin to add Mongoose.
Author: Metais Fabien
Latest version: 1.0.0-alpha.4.0

[![Build Status](https://drone.midgar.io/api/badges/Midgar/mongo/status.svg)](https://drone.midgar.io/Midgar/mongo) 
[![Coverage](https://sonar.midgar.io/api/project_badges/measure?project=midgar-mongo&metric=coverage)](https://sonar.midgar.io/dashboard?id=midgar-mongo)

## @midgar/mongo

Intégration de [Moogoose](https://mongoosejs.com) pour [Midgar](https://github.com/midgarjs/midgar)

## Installation

```sh
$ npm i @midgar/mongo
```
Si tout s'est bien passé, un message de confirmation s'affiche:

```sh
#midgar-cli
@midgar/mongo added to plugins.json !
```

## Configuration

Vous devez ajouter la confuguration suviante a votre projet avec un uri valide:

```js
 mongo: {
    default: {
      uri: 'mongodb://localhost:27017/midgar?connectTimeoutMS=1000',
    }
  }
```

Vous devez ajouter plusieur connection à la configuration:

```js
 mongo: {
    default: {
      uri: 'mongodb://localhost:27017/midgar?connectTimeoutMS=1000',
    },
    otherConnexion: {
      uri: 'mongodb://localhost:27017/otherDb?connectTimeoutMS=1000',
    }
  }
```

## Fonctionnement
Ce plugin ajoute un type de module **midgar-mongo-model** dans le dossier ./mongo-models/.

## Model

Voici un exemple de model:
```js
const name = 'namespace:monmodel'

export default {
  name,
  model: (mongoose) => {
    const schema = mongoose.Schema({
      name: {
        type: String,
        required: true
      },
      description: {
        type: String,
        required: true
      },
      type: {
        type: String,
        required: true
      }
    })

    return mongoose.model(name, schema)
  }
}
```

Vous trouverez plus d'informations sur la structure des model mongoose dans la [documentation](https://mongoosejs.com/docs/guide.html).

## Migration

Ce plugin ajoute un storage pour [@midgar/migrate](https://github.com/midgarjs/migrate)

### Exemple de fichier

```js
export default {
  up: async (mid, mongoService) => {
    const MonModel = mongoService.getModel('namespace:monmodel')
    const pulpFiction = new MonModel({ 
      name: 'Pulp Fiction', 
      description: 'L\'odyssée sanglante et burlesque de petits malfrats dans la jungle de Hollywoo.' 
      type: 'film'
    })

    await pulpFiction.save()
  },
  down: async (mid, mongoService) => {
    const pulpFiction = mongoService.getModel('namespace:monmodel')
    pulpFiction.deleteOne({ name: 'Pulp Fiction' })
  }
}

```
npm package: @midgar/route-loader
Description: A Migdar plugin to load routes
Author: Metais Fabien
Latest version: 1.0.0-alpha.1.7
Deprecated: Old plugin

In Dev don't use this

## @midgar/route-loader

It a plugin for [Midgar](https://www.npmjs.com/package/@midgar/midgar) to load routes

## Installation

```sh
$ npm install @midgar/route-loader --save
```

## Plugin dir
This plugin add a routes plugin dir.
It load all router in this directories.

## Router file

```js
const Router = require('@midgar/route-loader/libs/router')

class MyRouter extends Router {

  /**
   * return routes définitions
   */
  async getRoutes() {
    return [
      {
        method: 'post',
        path: '/login',
        action: '_login'
      },
      {
        path: '/customer',
        action: '_customer'
      }
    ]
  }

  _login(req, res) {
    let response = {
        success: true
    }
    res.json(response)
  }

  _customer(req, res) {
    const response = {
      name: 'foo'
    }

    res.json(response);
  }
}

module.exports = MyRouter
```
npm package: @midgar/sequelize
Description: A plugin to add sequelize to Midgar
Author: Metais Fabien
Latest version: 1.0.0-alpha.1.0

In Dev don't use this

## @midgar/sequelize

It a plugin for [Midgar](https://www.npmjs.com/package/@midgar/midgar) to add Sequelize to Midgar

## Installation

```sh
$ npm install @midgar/sequelize --save
```
## Service

This plugin add a service 'midgar:sequelize'
The service create db connexions defined in the midgar config and load models.

## Config

The db connexions is define in the midgar config.
Add a "db" key a the config root.

```json
{
  sequelize: {
    default: {
      dialect: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'user',
      password: 'password',
      database: 'midgar',
      logging: false,
      charset: 'utf8',
      collate: 'utf8_general_ci'
    }
  }
}
```

"default" is the connexion name. You can add multiple connexion here.
The dialect options can be found on the Sequelize [documentation](https://sequelize.org/master/manual/dialects.html)

## Connexion

A connexion is a Sequelize instance you can read Sequelize [documentation](https://sequelize.org/master/class/lib/sequelize.js~Sequelize.html) to read more about this.
You can get a connection with the getConnection() method on the service:


```json
// Get midgar:sequelize service
const sequelizeService = await midgar.getService('midgar:sequelize')
// Get default sequelize connexion
const defaultConnexion = db.getConnexion('default')
```

## Models

Create a file in the models directory (my-plugin/sequelize/models/ by default). The module return an Object whith the model and possibly a connexion. If no connection is defined, it use the default connexion.

```js
const Sequelize = require('sequelize');

class TestModel extends Sequelize.Model {
  static init(connexion, DataTypes) {
    return super.init(
      {
        name: {type: DataTypes.STRING, allowNull: false},
        description: {type: DataTypes.TEXT, allowNull: true},
        updatedAt: {
          allowNull: false,
          type: DataTypes.DATE,
          timestamps: true,
          defaultValue: DataTypes.NOW
        },
        createdAt: {
          allowNull: false,
          type: DataTypes.DATE,
          timestamps: true,
          defaultValue: DataTypes.NOW
        }
      },
      {
        modelName: 'test',
        sequelize: connexion
      }
    );
  }
}


module.exports = {
  model: TestModel,
  connexion: 'default'
}

```

Get Model instance

```js

// Get midgar:sequelize service
const sequelizeService = await midgar.getService('midgar:sequelize')
const myModel = sequelizeService.getModel('my-model')
```

## Cli

This plugin add some cli commands to manage db version.

```sh
npx midgar db:up
```

Execute all db schema and data migration not already executed.

```sh
npx midgar db:up 3
```

Execute 3 verions in pending list

```sh
npx midgar db:status
```

Show database status
npm package: @midgar/services
Description: A Midgar plugin to add service with dependency injection
Author: Metais Fabien
Latest version: 1.0.0-alpha.1.7

In Dev don't use this

## @midgar/services

It a plugin for [Midgar](https://www.npmjs.com/package/@midgar/midgar) to add services with dependency injection

## Installation

```sh
$ npm install @midgar/services --save
```

## Plugin dir
This plugin add a services plugin dir.
It load all services in this directories.

## Get service

This plugin add a function  "getService" on Midgar instance 

```js
const serviceInstance = await midgar.getService('myService')
```

or

```js
midgar.getService('myService').then(serviceInstance => {
  ...
})
```
## Service définition

Function service:

```js
function myService(midgar, db) {
  ...
}

module.exports = {
  service: myService,
  dependencies: [
    'db'
  ]
}
```

Class service:

```js
class MyService {
  constructor(midgar, db) {
  }
}

module.exports = {
  service: myService,
  dependencies: [
    'db'
  ]
}
```
npm package: @midhuhu/docx-exporter
Description: Docx template exporter with dynamic table rendering and image support
Author: midhuhu
Latest version: 0.1.1

# @midhuhu/docx-exporter


一个在浏览器/Node 环境通用的 DOCX 导出工具：用 docxtemplater 渲染普通占位符与图片，并自动将数据生成的表格 XML 替换到模板中。支持在模板表格内放置占位符，直接用生成表格替换该表，复用模板样式；也提供钩子与 XML 逃生口以应对特殊样式需求。(注：目前仅能解决自用项目中的业务需求，暂无其他拓展性的业务需求)

## 快速开始

```ts
import { exportDocx } from "@midhuhu/docx-exporter";

const out = await exportDocx({
  template: arrayBufferFromDocx,   // 必填：ArrayBuffer | Blob | Uint8Array
  data: {
    name: "示例",
    number: "20250101",
    // 表格配置 + 数据，键名以 $table_ 开头
    $table_a: {
      options: {
        // 可选：列宽、行高、字号、合并、对齐等
        columns: [
          { key: "seq", label: "序号", widthRatio: 1 },
          { key: "type", label: "分类", widthRatio: 2, merge: true },
          { key: "project", label: "检测项目", widthRatio: 4 },
          { key: "result", label: "检测结论", widthRatio: 3 },
        ],
        rowHeightCm: 1.1,
        font: "SimSun",
        // 进阶：可传 hooks / overrideTblPrXml / overrideTblGridXml / appendAfterTableXml
      },
      data: [
        { type: "A", seq: "1", project: "项目1", result: "通过" },
        { type: "A", seq: "2", project: "项目2", result: "通过" },
      ],
    },
  },
  // output 默认 blob；如需 ArrayBuffer 指定 output: "arraybuffer"
});
```

然后在浏览器用 `file-saver` 下载：

```ts
import { saveAs } from "file-saver";
saveAs(out as Blob, "export.docx");
```

## 模板约定

1) **表格占位符写在模板表格内**：在目标表格任意单元格放 `{$table_a}`（与数据键同名）。  
   - 渲染时会抽取该表的 `<w:tblPr>/<w:tblGrid>` 样式，并直接用生成表替换这张表，示例表不会残留。  
2) 普通占位符、图片仍由 docxtemplater 处理，图片支持 URL / data URI / base64 / ArrayBuffer。  
3) 如果模板里没有匹配表格，则会回退到普通占位符文本替换（需在正文放置占位符）。

## 数据结构

- 普通字段：任意键值（如 `name`, `number`）。  
- 表格字段：键名以 `$table_` 开头，值为：
  ```ts
  {
    options?: TableOptions; // 样式与钩子
    data: TableDataRow[] | TableGroup[];
  }
  ```
  - `TableDataRow = Record<string, string | number>`
  - `TableGroup = { items: TableDataRow[]; ...groupFields }`（会先展开，常用于纵向合并分类）

## 常用 TableOptions

- 列宽/合并：`columns[].widthRatio`、`columns[].merge`；或 `mergeColumns` 快捷设置。  
- 行高/字体/字号/加粗/对齐：`rowHeightCm`, `font`, `titleSize`, `headerSize`, `bodySize`, `headerBold`, `cellBold`, `align`。  
- 逃生口：`overrideTblPrXml`, `overrideTblGridXml`, `appendAfterTableXml`。  
- 钩子：
  ```ts
  hooks: {
    onCell?: (cell, rowIdx, colIdx) => TableCell | void;
    onRow?: (row, rowIdx) => TableRow | void;
    onTable?: (table) => Table | void;
  }
  ```
  可用于注入特殊属性、追加 run 等。

## 图片支持

- 支持 Blob/ArrayBuffer、data URI、纯 base64、URL（会 fetch）；  
- 可在占位值上带 `{ width, height, unit }`（unit 支持 px/cm）或直接传数字作为高度。

## 运行环境

- 浏览器：默认返回 `Blob`，可直接配合 `file-saver`。  
- Node：`output: "arraybuffer"` 时返回 ArrayBuffer；图片 base64 转换兼容无 `atob` 的环境。

## 开发与构建

```bash
pnpm install
pnpm dev              # playground 调试
pnpm build            # 生成 dist/index.js & d.ts
pnpm playground:build # 打包 playground
```

## 目录结构概览

- `src/index.ts`：主入口，解析数据、渲染 docxtemplater、注入表格 XML。  
- `src/table-builder.ts`：表格生成、样式克隆、钩子、逃生口。  
- `src/table-injector.ts`：表格 XML 注入逻辑。  
- `playground/`：Vite+Vue 示例与默认模板/data。
npm package: @midhunpm/node-text-width
Description: Find the width of text in Node JS
Latest version: 1.0.2

## node-text-width
A simple node library for find the width of text in Node JS, We are using canvas for analyze the width so it's lightweight and more quick than other librabries.

## How to use

```
const getWidth = require('node-text-width');

let width = getWidth("text", { font: "Arial", fontSize: 15});

```
### Options

| option | type | description|
|--|--|--|
| font | string | font name|
| fontSize | number | font size|
npm package: @midi-json-tools/json-midi-message-encoder
Description: https://github.com/andrewangelle/midi-json-tools/blob/main/packages/json-midi-message-encoder/README.md
Author: Andrew Angelle
Latest version: 2.0.1

https://github.com/andrewangelle/midi-json-tools/blob/main/packages/json-midi-message-encoder/README.md