Giter Site home page Giter Site logo

boywithkeyboard / wrangler.json Goto Github PK

View Code? Open in Web Editor NEW
9.0 0.0 1.0 411 KB

Configure Wrangler in the format of your choice.

Home Page: https://npmjs.com/@darkflare/wjson

License: Apache License 2.0

TypeScript 94.36% JavaScript 5.64%
cli cloudflare workers wrangler config javascript json yaml

wrangler.json's Introduction

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

wrangler.json's People

Contributors

boywithkeyboard avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

hkochniss

wrangler.json's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.