https://github.com/lttr/deno-dsc
Simple desired state configuration library, inspired by Powershell DSC
https://github.com/lttr/deno-dsc
deno desired-state-configuration dsc
Last synced: 3 months ago
JSON representation
Simple desired state configuration library, inspired by Powershell DSC
- Host: GitHub
- URL: https://github.com/lttr/deno-dsc
- Owner: lttr
- License: mit
- Created: 2020-07-10T19:42:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-12-12T10:16:13.000Z (6 months ago)
- Last Synced: 2025-12-13T20:29:36.276Z (6 months ago)
- Topics: deno, desired-state-configuration, dsc
- Language: TypeScript
- Homepage:
- Size: 81.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# deno-dsc
Simple desired state configuration library for `deno`. Inspired by
[Powershell DSC](https://docs.microsoft.com/en-us/powershell/scripting/dsc/overview/overview).
## What
When you need to get your system into desired state. Quickly, reliably,
repeatedly. You can use Ansible, Puppet, Powershell or something else. But this
is simple and you can use JavaScript/TypeScript. `Deno` is the only runtime
dependency.
## Why
I have built this to spin up my development machine using my
[dotfiles](https://github.com/lttr/dotfiles).
## How does it work
Based on your configuration the library build a dependency graph and executes
everything missing in right order. Every configuration is first tested and only
executed, when the test does not pass. Therefore it is idempotent - you can
start it multiple times without worries.
## Adding resource
Add configuration type and implement the resource
```typescript
export interface LoginShellConfig extends Config {
shell: "zsh";
}
export const LoginShell: SpecificResource = {
name: "loginShell",
get: (config) => {
//...
},
test: async (config, verbose) => {
//...
},
set: async (config, verbose) => {
//...
},
};
```
Add to list of types of resources
```typescript
type MyResources = Resources | SpecificResource;
```
Registr the new resource
```typescript
registerResource(LoginShell);
```
## Test
```
deno task test
```