Socket
Socket
Sign inDemoInstall

@rimiti/stimmy

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @rimiti/stimmy

Replace your string variables by your values easily.


Version published
Weekly downloads
550
decreased by-8.18%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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('{{', '}}')

From an array

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...

From an object

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

FAQs

Last updated on 25 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc