Nocturnal Pumpkin Maelstrom
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

json-token-replace

1.1.0 • Public • Published

json-token-replace

What does it do

Replace the token string {{hello}} in json with value from another json where key is token {"hello":"bye"}

Example:

Json with tokens: { "john":"Alex" }

Json: { "text": "hello {{john}}"}

Output: { "text": "hello Alex"}

Features

  • [✓] Easy to use

Fast setup

  1. Run npm install json-token-replace --save
  2. In your code:
const Jtr = require("json-token-replace");
const jtr = new Jtr();

let json_output = jtr.replace(require("./json_with_tokens.json"), require("./json.json"), "{{", "}}");
  1. If work add star ⭐️ at this project ❤️
  2. If you want help me: donate on paypal or become a backer on patreon.

For advanced configuration see INSTALL.md.

License

GNU GENERAL PUBLIC LICENSE

Copyright (c) 2018 Patryk Rzucidło (PTKDev)

install

npm i json-token-replace

Downloadsweekly downloads

5

version

1.1.0

license

GPL-3.0

homepage

ptkdev.io

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability