Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erdemkosk/padora
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.
https://github.com/erdemkosk/padora
Last synced: 9 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/erdemkosk/padora
- Owner: erdemkosk
- Created: 2023-08-14T20:09:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-27T20:10:32.000Z (over 1 year ago)
- Last Synced: 2024-09-19T08:09:05.660Z (3 months ago)
- Language: JavaScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Padora
![Logo](https://i.imgur.com/o3YthOy.png)
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
```bash
npm install padora
```
## Example```javascript
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
```bash
"This is innerExample value , it can work with array values , and it is amazing example"
```