Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tim-smart/fpk
Functional configuration management with Typescript
https://github.com/tim-smart/fpk
configuration configuration-management fpk kubernetes typescript
Last synced: 26 days ago
JSON representation
Functional configuration management with Typescript
- Host: GitHub
- URL: https://github.com/tim-smart/fpk
- Owner: tim-smart
- Created: 2020-05-24T03:33:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-25T05:02:31.000Z (over 1 year ago)
- Last Synced: 2024-12-27T17:13:05.513Z (about 1 month ago)
- Topics: configuration, configuration-management, fpk, kubernetes, typescript
- Language: TypeScript
- Homepage:
- Size: 1.66 MB
- Stars: 12
- Watchers: 4
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fpk
Functional configuration management.
Use Typescript / Javascript to generate yaml, json, ini (or register your own
format) configuration. Could be used for:- Generating configuration for Kubernetes
- Generating configuration for databases
- etc.## Why?
Functional programming and Typescript have some great traits, which are also
really beneficial when writing configuration:- Composition - you can build your configuration like lego.
- Re-usability - create functions that define entire workloads and reuse them
across projects.
- Type checking - intellisense FTW.## Packages
| Name | Description |
| ------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [`@fpk/core`](https://github.com/tim-smart/fpk/tree/master/packages/core) | Package that provides the config generation functionality |
| [`@fpk/cli`](https://github.com/tim-smart/fpk/tree/master/packages/cli) | The CLI tool for generating configuration |
| [`@fpk/k8s`](https://github.com/tim-smart/fpk/tree/master/packages/k8s) | Collection of functions for generating Kubernetes configuration |## Install
```
$ npm install -g @fpk/cli
$ fpk --help
```## Kubernetes Example Project
See https://github.com/tim-smart/fpk-k8s-example
## Basic Usage
### Create some configuration
`src/my-app.ts`
```typescript
export default {
"00-one": {
key: "value",
},"02-two": {
foo: false,
},"03-three.json": {
json: true,
},"04-four.ini": {
ini: "yes",
},
};
```## Generate the output
```
$ fpk -d src -o out
MKDIR my-app/
CREATE my-app/00-one.yaml
CREATE my-app/02-two.yaml
CREATE my-app/03-three.json$ tree out/
out
└── my-app
├── 00-one.yaml
├── 02-two.yaml
├── 03-three.json
└── 04-four.ini1 directory, 4 files
$ cat out/my-app/00-one.yaml
key: value
```