# @kenote/config

> Get profile module.

Latest version **1.0.40** (published 2022-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kenote/config
pnpm add @kenote/config
yarn add @kenote/config
bun add @kenote/config
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.40 |
| Published | 2022-08-18 |
| First published | 2021-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 15 |
| Unpacked size | 72.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | thondery |
| Maintainers | thondery |
| Keywords | config, kenote.js, yaml |

## Links

- npm: https://www.npmjs.com/package/@kenote/config
- Repository: https://github.com/kenote/kenote.js
- Homepage: https://github.com/kenote/kenote.js#readme
- Issues: https://github.com/kenote/kenote.js/issues
- npm.io page: https://npm.io/package/@kenote/config

## Dependencies (15)

- [async](https://npm.io/package/async.md) ^3.2.3
- [eval5](https://npm.io/package/eval5.md) ^1.4.7
- [esprima](https://npm.io/package/esprima.md) ^4.0.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.14.1
- [archiver](https://npm.io/package/archiver.md) ^5.3.1
- [nunjucks](https://npm.io/package/nunjucks.md) ^3.2.3
- [unzipper](https://npm.io/package/unzipper.md) ^0.10.11
- [escodegen](https://npm.io/package/escodegen.md) ^2.0.0
- [validator](https://npm.io/package/validator.md) ^13.7.0
- [@types/async](https://npm.io/package/@types/async.md) ^3.2.12
- [@types/js-yaml](https://npm.io/package/@types/js-yaml.md) ^3.12.6
- [@types/archiver](https://npm.io/package/@types/archiver.md) ^5.1.1
- [@types/nunjucks](https://npm.io/package/@types/nunjucks.md) ^3.2.1
- [@types/unzipper](https://npm.io/package/@types/unzipper.md) ^0.10.5
- [@types/validator](https://npm.io/package/@types/validator.md) ^13.7.1

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1.0.40 (latest) — 2022-08-18
- 1.0.38 — 2022-05-10
- 1.0.37 — 2022-05-10
- 1.0.36 — 2022-05-10
- 1.0.35 — 2022-04-21
- 1.0.32 — 2022-02-23
- 1.0.31 — 2022-02-18
- 1.0.28 — 2021-09-06
- 1.0.27 — 2021-08-04
- 1.0.10 — 2021-01-18
- 1.0.9 — 2021-01-18

## README

# @kenote/config

Get profile module

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Gratipay][licensed-image]][licensed-url]

[npm-image]: https://img.shields.io/npm/v/@kenote/config.svg
[npm-url]: https://www.npmjs.com/package/@kenote/config
[downloads-image]: https://img.shields.io/npm/dm/@kenote/config.svg
[downloads-url]: https://www.npmjs.com/package/@kenote/config
[licensed-image]: https://img.shields.io/badge/license-MIT-blue.svg
[licensed-url]: https://github.com/kenote/kenote.js/blob/main/LICENSE

## 使用方法

`data/config.yaml`
```yaml
host: localhost

port: 3000

site_name: 站点名称

redis:
  host: 127.0.0.1
  port: 6379
  db: 0
```

`data/index.js`
```js
module.exports = {
  a: 1
}
```

`app.ts`
```ts
import { loadConfig, asyncRequire } from '@kenote/config'

/**
 * 读取配置文件
 */
const config = loadConfig('data')
/**
 * 异步导入JS
 */
const ct = asyncRequire('./data')
```

---
MIT License.

---
_Source: https://npm.io/package/@kenote/config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
