2.0.3 • Published 1 year ago

simple-swap-d v2.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago