Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Streamed logger with multiple simltaneous output options.
The intention of this module is to allow pushing the log data to an API, some file and still be able to see the data in stdout.
Streams are based on scramjet
so you can use any transforms you like on your streams.
No colors, no fancy line drawing, nothing yet really - just a simple and parsable log output...
2018-06-29T15:07:37.339Z jetlog [info] defaultOutput(simple.js:52) Message1
2018-06-29T15:07:37.339Z jetlog [log] defaultOutput(simple.js:53) Message2
2018-06-29T15:07:37.339Z jetlog [error] defaultOutput(simple.js:54) Message3!
Simple version:
const logger = require('jetlog');
jetlog.log("Some message", {some_extra: data});
More complex version:
const {JetLog, Entry} = require('jetlog');
const logger = new JetLog({})
.catch(e => new Entry("Invalid log entry", e)); // remember to handle errors
logger
.use("my-decorator-module") // use stream modules to add data to logs
.toJSONStream() // use `scramjet` transforms to do anything you like to your logs
.tee(fs.createWriteStream("/var/log/myapp.log")) // push log to file
logger
.filter(({level}) => level >= 3) // use scramjet functions on entries
.stringify(myParser) // stringify your log
.pipe(process.stdout); // pipe anywhere you like
logger
.level("warn") // level will be assigned to the chained method
.use("my-reporter") // you can use own reporters
.pipe(process.stderr);
Jetlog's default logger (the one exposed as module.exports
) behavior can be changed using the following environment variables:
JETLOG_REPORTER
- choose reporter module "./lib/entry-reporter"
by default.JETLOG
- boolean - set to "0"
to disable stdout.JETLOG_FILTER
- only log if Entry matches any of the words (space separated).module.exports : JetLog
- the default export is a JetLog instance piped to stdout
using the standard log reporter.module.exports.getLog(name, pipeToOutput, reporter, filterArray)
- a facilitation method for creating loggersmodule.exports.JetLog
- the main logger class is exportedJetLog class implements the following methods:
new JetLog(options)
- constructorjetLog.level(value)
- creates a new piped stream containing only the required level (may be called multiple times).Logging methods are as follows in the following order:
Each log message is turned to a stream object.
Props:
entry.ts
- Timestamp when the entry was createdentry.msg
- Log messageentry.level
- Log level numeric value.entry.origin
- Logger name that contained this logentry.stack
- CallSite of the log (optional)entry.extra
- Array of any extra arguments passed on log timeJetLog is MIT licensed.
FAQs
Streamet logger with pluggable outputs and stream interface.
The npm package jetlog receives a total of 16 weekly downloads. As such, jetlog popularity was classified as not popular.
We found that jetlog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.