Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

jsx-spmlog

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsx-spmlog

add spm attribute to .jsx file

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

jsx-spmlog

为目录下所有jsx文件增删spm埋点

<a onClick="add" data-spm-click="gostr=/dd;locaid=db2ee5204;"></a>

1.引入模块

const spmlog = require('jsx-spmlog')

2.增加埋点

给标签增加data-spm-click属性,已有埋点的不会重复加

spmlog({ gostr: '/dd', // 必传! opr: 'add', // 非必填,默认是add path: '', // 非必传,默认是'src/**/*.jsx', selectors: '' // 非必传,默认是a标签和含有onClick属性的标签 })

3.移除埋点

把标签上的data-spm-click属性移除

spmlog({ opr: 'remove', // 必填 path: '', // 非必传,默认是'src/**/*.jsx', selectors: '' // 非必传,默认是所有含有data-spm-click属性的标签 })

FAQs

Package last updated on 24 Feb 2020

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