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

ghost-static

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

ghost-static - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

blog/2017/07/09/writing-typescript-for-the-tic-80/index.html

30

bin/scrap.js

@@ -31,19 +31,17 @@ #!/usr/bin/env node

*/
registerAction('onResourceSaved', ({ resource }) => {
registerAction('onResourceSaved', async ({ resource }) => {
let resPath = path.join(scraper.tmpFolder, resource.filename)
isBinary(resPath, (err, result) => {
if (err) throw err
if (!result) {
try {
let data = fs.readFileSync(resPath, 'utf8')
let result = data.replace(
new RegExp(scraper.localURL, 'g'),
scraper.publishURL
)
fs.writeFileSync(resPath, result, 'utf8')
} catch (e) {
console.error(e)
}
const binary = await isBinary(fs.readFileSync(resPath))
if (!binary) {
try {
let data = fs.readFileSync(resPath, 'utf8')
let result = data.replace(
new RegExp(scraper.localURL, 'g'),
scraper.publishURL
)
fs.writeFileSync(resPath, result, 'utf8')
} catch (e) {
console.error(e)
}
})
}
})

@@ -78,3 +76,3 @@

urls: [this.localURL],
plugins: [new RewritterPlugin(this.tmpFolder, this.publishURL)],
plugins: [new RewritterPlugin()],
requestConcurrency: 1,

@@ -81,0 +79,0 @@ directory: this.tmpFolder,

{
"name": "ghost-static",
"version": "0.2.1",
"version": "0.2.2",
"description": "A tool to convert you Ghost blog to a static website",

@@ -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