Giter Site home page Giter Site logo

stimmy's Introduction

stimmy

Build License PRs Welcome

Description

This module provides a string variables replacer.

Install

$ yarn add @rimiti/stimmy

Features

  • Can replace variables from an object.
  • Can replace variables from an array.

Documentation

Examples

From import

import { stimmy } from '@rimiti/stimmy';

From require

const { stimmy } = require('@rimiti/stimmy');

init pattern

// As default, use the {myVariable} pattern
const replacer = stimmy();

// If you want to customized default pattern (ex: {{myVariable}}
const replacer = stimmy('{{', '}}')
const str = replacer('This {0} is {1}!', ['module', 'awesome']);
// This module is awesome!
const str = replacer('{0}% of code coverage, it\'s {1}...', [100, 'so amazing']);
// 100% of code coverage, it's so amazing...
const str = replacer('{timmy} My hobby is {hobby}...', {timmy: 'Timmmmmmmyy !!', hobby: 'running'});
// Timmmmmmmyy !! My hobby is running...
const str = replacer('My name is {name}, I\'m {age}.', {name: 'stimmy', age: 25});
// My name is stimmy, I'm 25.

Scripts

Run using yarn run <script> command.

clean       - Remove temporarily folders.
build       - Compile source files.
build:watch - Interactive watch mode, compile sources on change.
lint        - Lint source files.
lint:fix    - Fix lint source files.
test        - Runs all tests with coverage.
test:watch  - Interactive watch mode, runs tests on change.

License

MIT © Dimitri DO BAIRRO

stimmy's People

Contributors

greenkeeper[bot] avatar rimiti avatar rustinlewis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rustinlewis

stimmy's Issues

NPM is saying it's been renamed to @rimiti/stimmy

npm install stimmy --save is saying it's been renamed to @rimiti/stimmy.

In order to install the newest version I had to install @rimiti/stimmy --save ... then you have to:

const stimmy = require('@rimiti/stimmy');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.