Socket
Socket
Sign inDemoInstall

gitbook-plugin-icp

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-icp - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

26

index.js
var fs = require('fs');
var path = require('path');
var cheerio = require('cheerio');
module.exports = {

@@ -11,10 +14,23 @@ hooks: {

var indexPath = path.join(process.cwd(), '_book', 'index.html');
console.log("number="+number+",indexPath="+indexPath);
var multilingual = this.isLanguageBook();
// if (number && fs.existsSync(indexPath)) {
// fs.createReadStream(indexPath).pipe(fs.createWriteStream(indexPath));
// }
console.log("number="+number+",indexPath="+indexPath+",multilingual="+multilingual);
if (multilingual && number && fs.existsSync(indexPath)) {
var indexText = fs.readFileSync(indexPath);
indexText = indexText.toString();
console.log(indexText);
$ = cheerio.load(indexText);
var str ='<div style="position: absolute;bottom: 0;left: 50%;transform: translate(-50%, -50%);">ICP证:<a href="http://beian.miit.gov.cn/" target="_blank" style="color:#f72b07">浙ICP备18042346号</a></div>';
$('body').append(str);
indexText = $.html();
console.log(indexText);
fs.writeFileSync(indexPath,indexText);
}
}
}
};

2

package.json
{
"name": "gitbook-plugin-icp",
"version": "0.0.4",
"version": "0.0.5",
"description": "gitbook plugin for adding icp info to footer",

@@ -5,0 +5,0 @@ "main": "index.js",

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