forked from 3nsoft/spec-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostinstall.js
More file actions
25 lines (18 loc) · 858 Bytes
/
postinstall.js
File metadata and controls
25 lines (18 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function is(it) {
return !!it && it !== '0' && it !== 'false';
}
const env = process.env;
const ADBLOCK = is(env.ADBLOCK);
const SILENT = ['silent', 'error', 'warn'].includes(env.npm_config_loglevel) ;
const COLOR = is(env.npm_config_color);
const BANNER = `\u001B[96mThank you for using spec-server (\u001B[94m https://github.com/3nsoft/spec-server.git \u001B[96m) of 3NWeb uitlity services. This server is developed together with defining 3NWeb protocols by PrivacySafe\u001B[0m
\u001B[96mThe project needs your help! Please consider supporting PrivacySafe on Open Collective: \u001B[0m
\u001B[96m>\u001B[94m https://opencollective.com/privacysafe \u001B[0m
`;
function isBannerRequired() {
if (ADBLOCK || SILENT) { return false; }
return true;
}
if (isBannerRequired()) {
console.log(COLOR ? BANNER : BANNER.replace(/\u001B\[\d+m/g, ''));
}