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

magicpen

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magicpen - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

lib/magicpen-default-format.js

1

gulpfile.js

@@ -16,2 +16,3 @@ var gulp = require('gulp');

'lib/magicpen-utils.js',
'lib/magicpen-default-format.js',
'lib/magicpen-core.js',

@@ -18,0 +19,0 @@ 'lib/magicpen-text-serializer.js',

@@ -27,2 +27,3 @@ /*global console, __dirname, weknowhow, Uint8Array, Uint16Array*/

'magicpen-utils.js',
'magicpen-default-format.js',
'magicpen-core.js',

@@ -29,0 +30,0 @@ 'magicpen-text-serializer.js',

@@ -104,2 +104,5 @@ /*global namespace*/

format = format || 'text';
if (format === 'auto') {
format = namespace.defaultFormat();
}
var serializer = new MagicPen.serializers[format]();

@@ -106,0 +109,0 @@ return serializer.serialize(this.output);

@@ -130,2 +130,55 @@ (function () {

(function () {
function supportsColors() {
// Copied from https://github.com/sindresorhus/supports-color/
// License: https://raw.githubusercontent.com/sindresorhus/supports-color/master/license
if (typeof process === 'undefined') {
return false;
}
if (process.argv.indexOf('--no-color') !== -1) {
return false;
}
if (process.argv.indexOf('--color') !== -1) {
return true;
}
if (process.stdout && !process.stdout.isTTY) {
return false;
}
if (process.platform === 'win32') {
return true;
}
if ('COLORTERM' in process.env) {
return true;
}
if (process.env.TERM === 'dumb') {
return false;
}
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
return true;
}
return false;
}
function defaultFormat() {
if (typeof window !== 'undefined' || typeof window.navigator !== 'undefined') {
return 'html'; // Browser
} else if (supportsColors()) {
return 'ansi'; // colored console
} else {
return 'text'; // Plain text
}
}
namespace.defaultFormat = defaultFormat;
}());
(function () {
var shim = namespace.shim;

@@ -232,2 +285,5 @@ var map = shim.map;

format = format || 'text';
if (format === 'auto') {
format = namespace.defaultFormat();
}
var serializer = new MagicPen.serializers[format]();

@@ -234,0 +290,0 @@ return serializer.serialize(this.output);

2

package.json
{
"name": "magicpen",
"version": "0.1.0",
"version": "0.1.1",
"description": "Styled output in both consoles and browsers",

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

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