Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

displace-comments

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

displace-comments

Replace the comment with an equal amount of space from the code string

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

displace-comments

提取文本中的注释,并将注释替换为等价的空格

支持的注释

  • html注释
  • JavaScript单行、多行注释和注解

安装

npm i displace-comments

使用

interface IdisplaceComments{
  (code:string,m?:{
    start: string;
    end: string | RegExp;
    type?: "single" | "multiple" | "html" | "custom";
  }):{
    strippedCode: string;
    detail: DetailItem[];
  }
}
import displaceComments from 'displace-comments'
const code = ''
displaceComments(code[,options])

示例

见test.js的执行结果

License

MIT

Keywords

FAQs

Package last updated on 13 May 2023

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc