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

simplert

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplert - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

17

index.js

@@ -237,7 +237,7 @@ const fs = require("fs");

fs.writeFile(filename, text, err => {
fs.writeFile(filename, formatText(text), err => {
if (err) return reject(err);
});
} else {
writeStream.write(text);
writeStream.write(formatText(text));
}

@@ -308,1 +308,14 @@ });

}
function formatText(text) {
let formattedText = text;
if (typeof text === "object") {
formattedText = JSON.stringify(text);
}
if (user_config.file.newline) {
formattedText += "\n";
}
return formattedText;
}

2

package.json
{
"name": "simplert",
"version": "0.6.1",
"version": "0.6.2",
"description": "Simple way to send alerts via Slack, Email, Discord, SMS, etc.",

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

@@ -29,3 +29,4 @@ # Simplert

"filesize": 10,
"maxfiles": 10
"maxfiles": 10,
"newline": true
},

@@ -60,2 +61,3 @@ "slack": {

***file:maxfiles*** - The maximum number of logs files to generate during log rotation. Example: a maxfiles of 10 and filesize of 5 would log the most recent 50MB of data across log.txt, log1.txt, log2.txt ... log9.txt
***file:newline*** - If true, will automatically add a newline to any text written. Default: true
***slack:send_to*** - The channel or user you want to send the message to. Examples: #some_channel or @some_user

@@ -97,3 +99,3 @@ ***slack:token*** - The token of your Slack bot. Make sure it has the right permissions setup to send messages.

*Send text to a file*
All values have to be set under `file:*` in your configuration file. Note: This will not add any newlines when writing to the file.
All values have to be set under `file:*` in your configuration file. Note: This function will automatically call JSON.stringify on any object passed in.

@@ -104,3 +106,3 @@ const simplert = require("simplert");

simplert.file("some event");
simplert.file(JSON.stringify({"data": "some data"}));
simplert.file({"data": "some data"});
---

@@ -107,0 +109,0 @@ #### **simplert.slack(message,[send_to])**

@@ -21,3 +21,4 @@ {

"filesize": 10,
"maxfiles": 10
"maxfiles": 10,
"newline": true
},

@@ -24,0 +25,0 @@ "slack": {

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