Skip to main content

Built and signed on GitHub Actions

A package to update deno.json or deno.jsonc config files easily via cli or exported function, without loosing comments.

This package works with Deno
This package works with Deno
JSR Score
100%
Published
6 months ago (1.0.6)
function updateConfig
updateConfig(
denoConfigPathOrUrl: string | URL,
updatedConfig: Record<string, any>,
): Promise<void>

Updates an existing deno.jsonc (or deno.json) file with the provided 'updatedConfig', while preserving comments.

CAUTION: This function does not do any validation of the updatedConfig! Make sure that you only use valid options for the deno.jsonc/deno.json file!

Parameters

denoConfigPathOrUrl: string | URL
updatedConfig: Record<string, any>

an updated config in the same format as the deno.jsonc file

Return Type

Promise<void>

Add Package

deno add jsr:@codemonument/update-denoconfig

Import symbol

import { updateConfig } from "@codemonument/update-denoconfig";

---- OR ----

Import directly with a jsr specifier

import { updateConfig } from "jsr:@codemonument/update-denoconfig";