Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "rss2mail", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Convert an rss/atom feed to a bunch of emails in mbox/rnews compatible output; it does NOT send the emails", | ||
@@ -26,5 +26,5 @@ "type": "module", | ||
"grepfeed": "~2.0.0", | ||
"lockfile": "~1.0.4", | ||
"proper-lockfile": "~4.1.2", | ||
"nodemailer": "~6.9.4" | ||
} | ||
} |
@@ -15,3 +15,3 @@ # rss2mail | ||
Nodejs 18.x | ||
Nodejs 20.x | ||
@@ -18,0 +18,0 @@ $ npm i -g rss2mail |
@@ -9,3 +9,3 @@ #!/usr/bin/env node | ||
import FeedParser from 'feedparser' | ||
import lockfile from 'lockfile' | ||
import lockfile from 'proper-lockfile' | ||
import MailStream from './index.js' | ||
@@ -35,24 +35,15 @@ | ||
let streams = [process.stdin, new FeedParser(), new MailStream(args)] | ||
if (!args.values.o) streams.push(process.stdout) | ||
let pipe = pipeline(...streams, err => { | ||
if (err && err.code !== 'EPIPE') errx(err) | ||
}) | ||
let out = process.stdout | ||
let lock = Promise.resolve( () => {/* nop */}) | ||
if (args.values.o) { | ||
pipe.on('data', chunk => { | ||
let out = fs.createWriteStream(args.values.o, {flags: 'a'}) | ||
out.on('error', errx) | ||
out.cork() | ||
out.write(chunk) // to memory | ||
out = fs.createWriteStream(args.values.o, {flags: 'a'}) | ||
lock = lockfile.lock(args.values.o, {retries: 10}) | ||
} | ||
streams.push(out) | ||
// we need locking for `chunk` may be > PIPE_BUF (4K on Linux) | ||
let lock = args.values.o + '.lock' | ||
lockfile.lock(lock, {wait: 5000}, err => { | ||
if (err) errx(err) | ||
out.uncork() // puts! | ||
lockfile.unlock(lock, err => { | ||
if (err) errx(err) | ||
out.end() // flush, close | ||
}) | ||
}) | ||
lock.then( unlock => { | ||
pipeline(...streams, err => { | ||
if (err && err.code !== 'EPIPE') errx(err) | ||
unlock() | ||
}) | ||
} | ||
}).catch(errx) |
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
0
8482
174
1
+ Addedproper-lockfile@~4.1.2
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedproper-lockfile@4.1.2(transitive)
+ Addedretry@0.12.0(transitive)
- Removedlockfile@~1.0.4
- Removedlockfile@1.0.4(transitive)