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

logmoji

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logmoji - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.github/workflows/docs.yaml

7

package.json
{
"name": "logmoji",
"version": "1.0.0",
"version": "1.0.1",
"description": "đŸĒĩ Very small logging package with emojis for node.js",
"main": "src/index.js",
"scripts": {
"test": "jest"
"test": "jest",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},

@@ -9,0 +12,0 @@ "keywords": [],

<p align="center" class="logo-section">
<img src="https://i.ibb.co/gvD8wP1/Vulcan-Salute-Medium-Skin-Tone.png" height="80" width="80"/>
</br>
<img src="https://halitsever-api.vercel.app/api/repo-title?title=LogMoji">
<img src="https://halitsever-api.vercel.app/api/repo-title?title=Logmoji">

@@ -6,0 +6,0 @@ <p align="center">

@@ -1,41 +0,41 @@

const main = (params) => {
const ConfigClass = require("./config.class");
const getDateLog = require("./utils/get-date-log");
const ConfigClass = require("./config.class");
const getDateLog = require("./utils/get-date-log");
const createLogger = (params) => {
const configInstance = new ConfigClass({ ...(params || {}) });
const config = configInstance.getConfig();
const success = (...args) => {
console.info(`${config?.timestamp ? getDateLog() : ""} ✅ Success: `, ...args);
};
const log = (level, ...args) => {
const logSymbols = {
success: "✅",
fail: "📛",
warn: "🟠",
error: "🚨",
info: "ℹī¸",
log: "📄",
};
const fail = (...args) => {
console.warn(`${config?.timestamp ? getDateLog() : ""} 📛 Fail: `, ...args);
};
const logFunction = {
success: console.info,
fail: console.warn,
warn: console.warn,
error: console.error,
info: console.info,
log: console.log,
};
const warn = (...args) => {
console.warn(`${config?.timestamp ? getDateLog() : ""} ⚠ī¸ Warning: `, ...args);
const timestamp = config?.timestamp ? getDateLog() : "";
logFunction[level](`${timestamp} ${logSymbols[level]} ${level.charAt(0).toUpperCase() + level.slice(1)}: `, ...args);
};
const error = (...args) => {
console.error(`${config?.timestamp ? getDateLog() : ""} 🚨 Error: `, ...args);
};
const info = (...args) => {
console.error(`${config?.timestamp ? getDateLog() : ""} ℹī¸ Info: `, ...args);
};
const log = (...args) => {
info(...args);
};
return {
success,
fail,
error,
info,
warn,
log,
success: (...args) => log("success", ...args),
fail: (...args) => log("fail", ...args),
error: (...args) => log("error", ...args),
info: (...args) => log("info", ...args),
warn: (...args) => log("warn", ...args),
log: (...args) => log("log", ...args),
};
};
module.exports = main;
module.exports = createLogger;
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