This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@darkflare/wjson
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

wjson

Configure Wrangler in the format of your choice.

Installation

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.

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)

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

{
  "$schema": "https://raw.githubusercontent.com/azurydev/wjson/dev/schema.json",
  // your config (w/ autocomplete)
}

js/mjs/ts

import { defineConfig } from 'wjson'

export default defineConfig({
 // your config (w/ autocomplete)
})

js/cjs

const { defineConfig } = require('wjson')

module.exports = defineConfig({
 // your config (w/ autocomplete)
})

yaml/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

Chat with us

Join our Discord

Package Sidebar

Install

npm i @darkflare/wjson

Weekly Downloads

2

Version

0.4.3

License

Apache-2.0

Unpacked Size

148 kB

Total Files

11

Last publish

Collaborators

  • unvented