🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

htmlstrrep

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmlstrrep

replace string for html

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

HtmlStrRep for html string repalce with keywords

HtmlStrRep install

  npm install htmlstrrep --save-dev

HtmlStrRep for ES6


  import HtmlStrRep from 'htmlstrrep'
  const strRep = new HtmlStrRep()

  /*
  * str: Origin string (原始字符串)
  * sFrom: will be repalce this string (被替换的字符串)
  * sTo:  sFrom => sTo
  * */
  let endStr = strRep.startRep(str, sFrom, sTo)
  console.log(endStr)
  
  // for example
  let newStr = strRep.startRep('<div><a href="www.hansin.com">hansin</a><div>hansinhu</div></div>', 'han', '<span style="color: red;">han<span>')
  console.log(newStr)

update:

npm login
// 用户名:hansin
// 密码:****
// 邮箱:hansincn@gmail.com 
npm version patch 
npm publish

Keywords

html

FAQs

Package last updated on 23 Mar 2018

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