Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sigmasd/chef
Personal package manager
https://github.com/sigmasd/chef
automation pacakge-manager
Last synced: 25 days ago
JSON representation
Personal package manager
- Host: GitHub
- URL: https://github.com/sigmasd/chef
- Owner: sigmaSd
- Created: 2022-08-06T16:30:18.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-19T06:24:00.000Z (6 months ago)
- Last Synced: 2024-05-19T07:26:12.819Z (6 months ago)
- Topics: automation, pacakge-manager
- Language: TypeScript
- Homepage: https://jsr.io/@sigmasd/chef
- Size: 62.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chef
Personal package manager
## Why it exists
This is useful for those binaries that are not packaged by a distro.
With chef you can:
- Install a random binary
- Keep it up-to-date
- Run it## Usage
Create a file for example **chef.ts** with:
```typescript
import { Chef } from "jsr:@sigmasd/chef";const chef = new Chef();
chef.add({
name: "binary1",
download: () => {
// a fuction that downloads the binary and return its relative path
},
version: () => {
// a function that returns the latest version of the binary
},
});await chef.run();
```For a better experience install it with deno install (make sure `~/.deno/bin` is
in your path):`deno install -A -n chef chef.ts`
You can now use:
- `chef update` to update all binaries (or install it if it doesn't exist yet)
- `chef list` to list currently binaries
- `chef run ${binary} $args` to run one of the installed binariesCheckout `bin` direcotry for more examples.
## Examples
**Example 1**
```ts
import { $ } from "jsr:@david/[email protected]";
import { Chef } from "jsr:@sigmasd/chef";
import { getLatestGithubRelease, getLatestNpmVersion } from "jsr:@sigmasd/chef/utils";if (import.meta.main) {
const chef = new Chef();
chef.addMany(
[
{
name: "slint-lsp",
download: async () => {
await $.request(
"https://github.com/slint-ui/slint/releases/download/v1.5.1/slint-lsp-linux.tar.gz",
).pipeToPath();
await $`tar -xzf slint-lsp-linux.tar.gz`;
return {
exe: "./slint-lsp/slint-lsp",
};
},
version: () => getLatestGithubRelease("slint-ui/slint"),
},
{
name: "typescript-language-server",
download: async () => {
await $`npm install typescript-language-server`;
return {
exe: "./node_modules/typescript-language-server/lib/cli.mjs",
dir: ".",
};
},
version: () => getLatestNpmVersion("typescript-language-server"),
},
],
);await chef.start();
```