Launch Week Day 1:Rust Support in Socket Is Now Generally Available.Learn More
Socket
Book a DemoInstallSign in
Socket

mkup

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkup

transparently insert metadata chars into a string at offsets without affecting the overall offset

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

mkup

Insert metadata characters into a string without affecting the indexing of the string. Useful for inserting color codes into a string of javascript.

var mkup = require('mkup')

var decorate = mkup('some string')

decorate
  .insert(2, 'xx')
  .insert(3, 'xx')

console.log(decorate.toString()) // == 'soxxmxxe string'

api

mkup(String) -> Decorator instance

Create a new Decorator instance.

Decorator#insert(index, str) -> itself

Insert markup str at index in original content. Returns itself. Mutates the decorator instance.

Decorator#toString() -> String

Render the string.

license

MIT

Keywords

markup

FAQs

Package last updated on 23 Feb 2014

Did you know?

Socket

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