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

html-str-replace

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-str-replace

replace string for html

latest
Source
npmnpm
Version
3.0.2
Version published
Maintainers
1
Created
Source

HtmlStrRep for html string repalce with keywords

HtmlStrRep install

  npm install html-str-replace --save

HtmlStrRep for ES6


// 使用
<template>
  <div class="home">
    <h3>Html rep Test</h3>
    <h4 v-html="keyName(tHtml, tkey, '#407CFE')"></h4>
  </div>
</template>

import HtmlStrRep from 'html-str-replace'
export default {
  name: 'home',
  data () {
    return {
      tHtml: '<div>this is hansin; this is Hansin; this is hanSin <span class="hansin">hansintest</span></div>',
      tkey: 'hansin'
    }
  },
  methods: {
    keyName (html, keywords) {
      const strRep = new HtmlStrRep()
      return strRep.startRep(html, keywords, '#407CFE')
    }
  }
}

update:

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

Keywords

replace

FAQs

Package last updated on 14 Sep 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