simple-swap-d

2.0.3 • Public • Published

Simple Swap

Simple Swap is a minimalistic template engine for string interpolation in JavaScript, inspired by swap.js. It allows you to easily inject values into a string template.

Features

  • Simple and lightweight
  • No external dependencies
  • Easy to integrate and use in any JavaScript project

Installation

Since this is a basic project example, you can integrate it directly by copying the index.js file into your project.

Usage

Here is a quick example of how to use Simple Swap:

const simpleSwap = require('./index');

const template = '{name} is {age} years old.';
const data = { name: 'Alex', age: '30' };
console.log(simpleSwap(template, data));
// Output: Alex is 30 years old.

Running Tests

Ensure you have Node.js installed, then run the following command to execute the tests:

npm install
npm test

NPM badge

npm version

Package Sidebar

Install

npm i simple-swap-d

Weekly Downloads

11

Version

2.0.3

License

ISC

Unpacked Size

3.19 kB

Total Files

6

Last publish

Collaborators

  • dlitztu