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

blake

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blake - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

51

lib/generate.js

@@ -12,5 +12,4 @@

, read = reader(props).read
, currentFilename = null
, count = 0
, ended = false
, queue = []

@@ -20,2 +19,6 @@ stream.writable = true

stream.pause = function () {
stream.emit('pause')
}
stream.resume = function () {

@@ -30,31 +33,20 @@ stream.emit('resume')

stream.write = function (filename) {
queue.push(filename)
work()
return true
handle(filename)
return false
}
function work () {
var filename = queue[0]
function handle (filename) {
count++
read(filename, function (err, item) {
if (err) {
count--
stream.emit('error', err)
stream.emit('drain')
return
}
if (filename === currentFilename) {
return
}
if (!filename && ended) {
stream.emit('end')
return
}
currentFilename = filename
read(filename, function (err, item) {
bake(item, function (err) {
if (err) {
stream.emit('error', err)
}
stream.emit('data', item.path)
queue.shift()
work()
count--
err ? stream.emit('error', err) : stream.emit('data', item.path)
stream.emit(ended && !count ? 'end' : 'drain')
})

@@ -66,5 +58,4 @@ })

if (!item.bake) {
return callback(new Error(
'Undefined bake function for ' + item.name
))
callback(new Error('Undefined bake function for ' + item.name))
return
}

@@ -71,0 +62,0 @@

@@ -17,2 +17,7 @@ // read - read files and return blake items

me.read = function (path, callback) {
if (!path) {
callback(new Error('No Path'))
return
}
fs.stat(path, function (err, stats) {

@@ -19,0 +24,0 @@ if (stats.isDirectory()) {

{
"name": "blake",
"description": "Simple, blog aware infrastructure to generate static sites",
"version": "0.6.2",
"version": "0.6.3",
"homepage": "http://michaelnisi.github.com/blake/",

@@ -6,0 +6,0 @@ "repository": {

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