Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boywithkeyboard-archive/wrangler.json
Configure Wrangler in the format of your choice.
https://github.com/boywithkeyboard-archive/wrangler.json
cli cloudflare config javascript json workers wrangler yaml
Last synced: about 2 months ago
JSON representation
Configure Wrangler in the format of your choice.
- Host: GitHub
- URL: https://github.com/boywithkeyboard-archive/wrangler.json
- Owner: boywithkeyboard-archive
- License: apache-2.0
- Archived: true
- Created: 2022-07-02T22:12:08.000Z (over 2 years ago)
- Default Branch: dev
- Last Pushed: 2022-10-05T06:42:25.000Z (about 2 years ago)
- Last Synced: 2024-06-28T13:50:18.640Z (5 months ago)
- Topics: cli, cloudflare, config, javascript, json, workers, wrangler, yaml
- Language: TypeScript
- Homepage: https://npmjs.com/@darkflare/wjson
- Size: 401 KB
- Stars: 9
- Watchers: 0
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
wjson
✨ Configure Wrangler in the format of your choice. ✨## Installation
```bash
npm i -D @darkflare/wjson
```## Usage (CLI)
Run the below command and **wjson** will automatically search for your configuration file and generate a `wrangler.toml` for you.
```bash
wjson
```### Automatically Detectable Files
- `wrangler.json`
- `wrangler.jsonc`
- `wrangler.js`
- `wrangler.mjs`
- `wrangler.cjs`
- `wrangler.ts`
- `wrangler.yaml`
- `wrangler.yml`### Options
- `--config` to use a custom config, e.g. `wjson --config="./my.json"`
## Usage (API)
```javascript
import { join } from 'node:path'
import { generateConfig, parseConfig } from 'wjson'// get the config from a file
const config = await parseConfig(join(someDirectory, './custom.json'))// alternatively, you can only specify the directory name
const config = await parseConfig(someDirectory)// generate a wrangler.toml from a config
await generateConfig(config)
```## Config Files
`json/jsonc`
```jsonc
{
"$schema": "https://raw.githubusercontent.com/azurydev/wjson/dev/schema.json",
// your config (w/ autocomplete)
}
````js/mjs/ts`
```javascript
import { defineConfig } from 'wjson'export default defineConfig({
// your config (w/ autocomplete)
})
````js/cjs`
```javascript
const { defineConfig } = require('wjson')module.exports = defineConfig({
// your config (w/ autocomplete)
})
````yaml/yml`
```yml
accountId: '0123456789'development:
name: 'my-awesome-worker'# your config
```## Config Syntax
- all options must be specified in `camelCase`
- `vars` option was renamed to `variables`
- `nodeComp` option was renamed to `nodeCompatibility`
- any environment-related options must be specified under `development` *(global, default)*, `staging`, or `production`