New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

js-embedder

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-embedder

Embed code in JavaScript file.

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

js-embedder

向 JavaScript 文件中嵌入代码

const embedder = require('js-embedder');

embedder([
  {
    file: '待修改的文件绝对路径',
    embeds: [
      {
        insert: N,         // 在第 N 行之前,插入 code
        code: ...,         // 插入的代码
      },
      {
        replace: [X, Y],   // 从第 X 行到第 Y 行,替换为 code
        code: ...,         // 替换的代码
      },
      {
        insert: N,         // 优先使用 insert
        replace: [X, Y]    // replace 不起作用
        code: ...,
      },
    ],
  },
  {
    file: '待复原的文件绝对路径',
    embeds: null,          // 文件恢复到未修改状态
  }
]);

FAQs

Package last updated on 08 Jul 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

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