Socket
Socket
Sign inDemoInstall

lightercollective

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightercollective - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

test/logo.txt

74

index.js
#!/usr/bin/env node
// (C) Andrea Giammarchi - @WebReflection (ISC)
var path = require('path');
var json = path.resolve('./package.json');
var package = require(json);
var collective = package.collective;
if (
!collective ||
-1 < ['silent', 'error', 'warn'].indexOf(process.env.npm_config_loglevel) ||
/^(?:1|true|yes|y)$/i.test(process.env.DISABLE_OPENCOLLECTIVE)
) {
try {
var json = path.resolve('./package.json');
var package = require(json);
// be sure collective is there and refers to lightercollective
var collective = (
(package.dependencies || {}).lightercollective ||
(package.devDependencies || {}).lightercollective
) && package.collective;
if (
!collective ||
-1 < ['silent', 'error', 'warn'].indexOf(process.env.npm_config_loglevel) ||
/^(?:1|true|yes|y)$/i.test(process.env.DISABLE_OPENCOLLECTIVE)
) {
throw 0;
}
if (collective.logo) {
if (/^(https?):/.test(collective.logo))
require(RegExp.$1)
.get(collective.logo, function (response) {
if (response.statusCode === 200) {
response.setEncoding('utf8');
var data = [];
response.on('data', function (chunk) { data.push(chunk); });
response.on('end', function () { showLogo(data.join('')) });
}
else showLogo(null);
})
.on('error', showLogo);
else
require('fs').readFile(
path.resolve(path.dirname(json), collective.logo),
function (err, data) {
showLogo(err ? null : data.toString())
}
)
}
else showLogo(null);
} catch(o_O) {
process.exit(0);
}
if (collective.logo) {
if (/^(https?):/.test(collective.logo))
require(RegExp.$1)
.get(collective.logo, function (response) {
if (response.statusCode === 200) {
response.setEncoding('utf8');
var data = [];
response.on('data', function (chunk) { data.push(chunk); });
response.on('end', function () { showLogo(data.join('')) });
}
else showLogo(null);
})
.on('error', showLogo);
else
require('fs').readFile(
path.resolve(path.dirname(json), collective.logo),
function (err, data) {
showLogo(err ? null : data.toString())
}
)
}
else showLogo(null);
function showLogo(data) {

@@ -48,4 +56,4 @@ var logo = typeof data === 'string' ? data : '';

console.log('');
console.log('Please consider donating to our open collective');
console.log(' to help us maintain this package.');
console.log(' Please consider donating to our open collective');
console.log(' to help us maintain this package.');
console.log('');

@@ -57,2 +65,2 @@ console.log(' ' + collective.url + '/donate');

process.exit(0);
}
}
{
"name": "lightercollective",
"version": "0.2.0",
"version": "0.3.0",
"description": "a basic postinstall only binary based on package.json collective info",

@@ -5,0 +5,0 @@ "bin": "./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