@vakra-dev/reader 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
+ }) : x)(function(x) {
5
+ if (typeof require !== "undefined") return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
+ });
2
8
 
3
9
  // src/cli/index.ts
4
10
  import { Command } from "commander";
@@ -1161,11 +1167,20 @@ function extractTwitterCard(document) {
1161
1167
 
1162
1168
  // src/utils/logger.ts
1163
1169
  import pino from "pino";
1170
+ function hasPinoPretty() {
1171
+ try {
1172
+ __require.resolve("pino-pretty");
1173
+ return true;
1174
+ } catch {
1175
+ return false;
1176
+ }
1177
+ }
1164
1178
  function createLogger(name = "reader", level = process.env.LOG_LEVEL || "info") {
1179
+ const usePretty = process.env.NODE_ENV !== "production" && hasPinoPretty();
1165
1180
  return pino({
1166
1181
  name,
1167
1182
  level,
1168
- transport: process.env.NODE_ENV !== "production" ? {
1183
+ transport: usePretty ? {
1169
1184
  target: "pino-pretty",
1170
1185
  options: {
1171
1186
  colorize: true,