JSPM

padora

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 82
  • Score
    100M100P100Q69280F
  • License ISC

This tool, fills placeholders in a text with real values from a provided dataset, making it easy to create dynamic content.

Package Exports

  • padora

Readme

Padora

Logo

This is designed to fill placeholders (template strings) in the input text with corresponding values from a given data object. It essentially performs template interpolation, replacing placeholders with actual data values, allowing for dynamic content generation in text templates.

Installation

Install my-project with npm

  npm install padora

Example

const template = "This is {inner.1.2.test} value , it can work with {inner.1.2.array[0]} {inner.1.2.array[1]} , and it is amazing {example}";
const data = {
    example: "example",
    inner: {
      1: {
        2: {
          test: "innerExample",
          array: ['array', 'values'],
        },
      },
    },
  };

Result

"This is innerExample value , it can work with array values , and it is amazing example"