UNPKG

895 BJavaScriptView Raw
1"use strict";
2// tslint:disable
3/* Adapted from nodemon's postinstall: https://github.com/remy/nodemon/blob/master/bin/postinstall.js */
4function printSupportMessage() {
5 console.log("\u001b[32mLove TypeGraphQL or use it at work? \nYou can now support the project via the Open Collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/typegraphql\u001b[0m\n");
6}
7if (!process.env.SUPPRESS_SUPPORT) {
8 try {
9 const Configstore = require("configstore");
10 const pkg = require("../package.json");
11 const now = Date.now();
12 const week = 1000 * 60 * 60 * 24 * 7;
13 const conf = new Configstore(pkg.name);
14 const last = conf.get("lastCheck");
15 if (!last || now - week > last) {
16 printSupportMessage();
17 conf.set("lastCheck", now);
18 }
19 }
20 catch (e) {
21 printSupportMessage();
22 }
23}