utilitas 1990.1.35 → 1990.1.38

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.
@@ -31,9 +31,3 @@ jobs:
31
31
  - run: npm publish
32
32
  env:
33
33
  NODE_AUTH_TOKEN: ${{secrets.npm_token}}
34
-
35
- # publish-npm:
36
- # needs: build
37
- # runs-on: ubuntu-latest
38
- # steps:
39
- # - uses: actions/checkout@v3
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # utilitas
2
2
 
3
+ [![MIT licensed](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)
4
+ [![Node.js Package](https://github.com/Leask/utilitas/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/Leask/utilitas/actions/workflows/npm-publish.yml)
5
+
3
6
  Just another common utility for JavaScript.
4
7
 
5
8
  Works in Node.js and modern browsers.
package/lib/dbio.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { assertSet, ensureArray, log as _log } from './utilitas.mjs';
2
+ import { isPrimary } from 'cluster';
2
3
 
3
4
  const defaultPort = 3306;
4
5
  const orders = { '+': 'ASC', '-': 'DESC' };
@@ -15,10 +16,10 @@ const init = async (options) => {
15
16
  if (options) {
16
17
  const mysql = await import('mysql2/promise');
17
18
  pool = mysql.createPool(options);
18
- if (!options.silent) {
19
- log(`Initialized: mysql://${options.user}@${options.host}`
20
- + `:${options.port || defaultPort}/${options.database} .`);
21
- }
19
+ isPrimary && !options.silent && log(
20
+ `Initialized: mysql://${options.user}@${options.host}`
21
+ + `:${options.port || defaultPort}/${options.database} .`
22
+ );
22
23
  }
23
24
  assert(pool, 'Database has not been initialized.', 501);
24
25
  return pool;
package/lib/email.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { isPrimary } from 'cluster';
2
+
1
3
  import {
2
4
  assertEmail, ensureArray, log as _log, throwError, trim, uniqueArray, which
3
5
  } from './utilitas.mjs';
@@ -33,9 +35,9 @@ const init = async (options) => {
33
35
  default:
34
36
  throwInvalidProvider();
35
37
  }
36
- if (!options.silent) {
37
- log(`Initialized: ${senderName} <${senderEmail}> via ${provider}.`);
38
- }
38
+ isPrimary && !options.silent && log(
39
+ `Initialized: ${senderName} <${senderEmail}> via ${provider}.`
40
+ );
39
41
  }
40
42
  assert(client, 'Email client has not been initialized.', 501);
41
43
  return client;
package/lib/manifest.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1990.1.35",
4
+ "version": "1990.1.38",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/lib/sentinel.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { isPrimary } from 'cluster';
1
2
  import { log as _log } from './utilitas.mjs';
2
3
 
3
4
  const log = (content) => _log(content, import.meta.url);
@@ -13,7 +14,7 @@ const init = async (options) => {
13
14
  if (options) {
14
15
  sentry = await import('@sentry/node');
15
16
  sentry.init(Object.assign({ integrations }, options));
16
- if (!options.silent) { log(`Initialized, dsn: ${options.dsn} .`); }
17
+ isPrimary && !options.silent && log(`Initialized, dsn: ${options.dsn} .`);
17
18
  }
18
19
  assert(sentry, 'Sentry has not been initialized.', 501);
19
20
  return sentry;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1990.1.35",
4
+ "version": "1990.1.38",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",