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

nx-logger

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nx-logger - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

9

dist/log.d.ts

@@ -20,7 +20,12 @@ export declare namespace nxLogger {

type TransportFn = (configuration: Config, messages: Message[]) => Result;
type Formatter = (format: string, args: any[]) => string;
type Inspect = (object: any, options?: any) => string;
type Handler = (message: Message, callback: Function) => Function;
type HandlerFactory = (log: Log) => Handler;
interface Log {
(message: Message): Result;
(message: any): Result;
(message: Message, ...messages: any[]): Result;
readonly configuration: Config;
create: SimplyFactoryFn;
on: (message: Message, callback: Function) => Function;
on: Handler;
}

@@ -27,0 +32,0 @@ type FactoryFn = (configuration: ConfigPartial) => Log;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util = require("util");
const formatter = (format, args) => util.format(format, ...args);
const inspect = (object, options = {}) => typeof object === 'string' ?
object : util.inspect(object, options);
const transport = (config, messages) => {
const namespace = config.namespace.join(':');
const [format, ...args] = messages;
const message = messages.length > 1 ? formatter(format, args) : inspect(messages[0]);
console.log(`${namespace} - ${message}`);
};
// Global LogConfig

@@ -7,3 +17,3 @@ const baseConfiguration = {

namespace: [],
transport: (config, messages) => console.log(`${config.namespace.join(':')} - ${messages.join(' ')}`),
transport,
tty: true,

@@ -35,2 +45,3 @@ };

log.create = logFactoryCreator(configuration);
log.on = logHandlerFactory(log);
return log;

@@ -43,2 +54,6 @@ };

};
const logHandlerFactory = log => (message, callback) => (...args) => {
log(message, args);
return callback(...args);
};
exports.create = logFactory(baseConfiguration).create;
{
"author": "Tobias Kopelke <nox@raynode.de>",
"dependencies": {},
"dependencies": {
"cpx": "^1.5.0"
},
"description": "",
"devDependencies": {
"@types/faker": "^4.1.0",
"@types/mocha": "^2.2.41",
"@types/node": "^7.0.31",
"typescript": "^2.3.4"
"@types/sinon": "^2.3.1",
"ava": "^0.19.1",
"faker": "^4.1.0",
"mocha": "^3.4.2",
"npm-scripts-info": "^0.3.6",
"sinon": "^2.3.4",
"ts-mocha": "^1.0.3",
"ts-node": "^3.0.6",
"typescript": "^2.3.4",
"unexpected": "^10.29.0"
},

@@ -25,11 +38,27 @@ "files": [

"scripts": {
"build": "tsc",
"info": "npm-scripts-info",
"build": "tsc -p tsconfig.build.json",
"prepare": "npm run build",
"preupload": "npm version patch",
"postupload": "git push",
"test": "echo \"Error: no test specified\" && exit 1",
"test": "ts-mocha -p tsconfig.json tests/*.spec.ts",
"upload": "npm publish"
},
"scripts-info": {
"info": "Display information about the scripts",
"build": "(Trash and re)build the library",
"lint": "Lint all typescript source files",
"unit": "Build the library and run unit tests",
"test": "Lint, build, and test the library",
"watch": "Watch source files, rebuild library on changes, rerun relevant tests",
"cov": "Run tests, generate the HTML coverage report, and open it in a browser",
"docs": "Generate HTML API documentation and open it in a browser",
"docs:publish": "Generate HTML API documentation and push it to GitHub Pages",
"docs:json": "Generate API documentation in typedoc JSON format",
"changelog": "Bump package.json version, update CHANGELOG.md, tag a release",
"reset": "Delete all untracked files and reset the repo to the last commit",
"release": "Clean, build, test, publish docs, and prepare release (a one-step publish process)"
},
"types": "dist/log.d.ts",
"version": "1.0.11"
"version": "1.0.12"
}
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