diff --git a/check-required-env/deno.jsonc b/check-required-env/deno.jsonc index 0ee7324..4267c8c 100644 --- a/check-required-env/deno.jsonc +++ b/check-required-env/deno.jsonc @@ -8,5 +8,8 @@ }, "imports": { "@frytg/logger": "jsr:@frytg/logger@0.0.2" + }, + "publish": { + "exclude": ["*.test.ts"] } } diff --git a/crypto/generate-default-keys.ts b/crypto/generate-default-keys.ts index 9d314da..2aa307e 100644 --- a/crypto/generate-default-keys.ts +++ b/crypto/generate-default-keys.ts @@ -1,11 +1,12 @@ /** - * @module * Run key generation for default key sizes and print the results to the console * * @example * ```bash * deno run jsr:@frytg/crypto/generate-default-keys * ``` + * + * @module */ // load module diff --git a/crypto/generate-key.ts b/crypto/generate-key.ts index 28e1357..e0fba5d 100644 --- a/crypto/generate-key.ts +++ b/crypto/generate-key.ts @@ -1,7 +1,5 @@ // deno-lint-ignore-file no-console /** - * @module - * * This module provides a function to generate a key of the specified number of bytes and print the key in base64 and hex to the console or return the key as a Buffer. * * @example @@ -10,6 +8,8 @@ * * generateKey(32, true) * ``` + * + * @module */ // load packages diff --git a/crypto/hash.ts b/crypto/hash.ts index e3b41c1..80fc6bb 100644 --- a/crypto/hash.ts +++ b/crypto/hash.ts @@ -1,13 +1,14 @@ /** - * @module * {@linkcode hashSha256 | SHA-256} and {@linkcode hashSha512 | SHA-512} hash functions * - * @example + * @example Hash SHA-256 * ```ts * import { hashSha512 } from '@frytg/crypto/hash' * * hashSha512('hello world') * ``` + * + * @module */ // load packages diff --git a/crypto/hmac.ts b/crypto/hmac.ts index 3408e44..734b007 100644 --- a/crypto/hmac.ts +++ b/crypto/hmac.ts @@ -1,13 +1,14 @@ /** - * @module * {@linkcode hmacSha256 | HMAC SHA-256} and {@linkcode hmacSha512 | HMAC SHA-512} hash functions * - * @example + * @example HMAC SHA-512 * ```ts * import { hmacSha512 } from '@frytg/crypto/hmac' * * hmacSha512('hello world', '0123456789abcdef') * ``` + * + * @module */ // load packages diff --git a/dates/README.md b/dates/README.md index 5ab9c29..c93aa24 100644 --- a/dates/README.md +++ b/dates/README.md @@ -5,6 +5,12 @@ This is a simple opinionated wrapper around the [Luxon](https://github.com/moment/luxon) library to provide pre-configured helpers. +```ts +import { getISO } from '@frytg/dates'; + +getISO(); // returns string like 2025-01-01T00:00:00.000Z +``` + ## Author Created by [@frytg](https://github.com/frytg) / [frytg.digital](https://www.frytg.digital) diff --git a/dates/dates.ts b/dates/dates.ts index 1f18bdb..230b959 100644 --- a/dates/dates.ts +++ b/dates/dates.ts @@ -6,7 +6,15 @@ const LOCAL_TIMEZONE = 'Europe/Amsterdam' const DATE_HOUR_MINUTES_FORMAT = 'ccc, d. LLLL yyyy - h:mma' /** - * Luxon DateTime + * Export DateTime from Luxon + * @returns {DateTime} DateTime + * + * @example + * ```ts + * import { DateTime } from '@frytg/dates' + * + * DateTime.fromMillis(1719859200000) + * ``` */ export { DateTime } @@ -17,7 +25,7 @@ export { DateTime } * * @example * ```ts - * import { toLocal } from 'jsr:@frytg/dates' + * import { toLocal } from '@frytg/dates' * * toLocal(getNow()) * ``` @@ -31,7 +39,7 @@ export const toLocal = (date: DateTime): DateTime => date.setZone(LOCAL_TIMEZONE * * @example * ```ts - * import { msToUnix } from 'jsr:@frytg/dates' + * import { msToUnix } from '@frytg/dates' * * msToUnix(getMs()) * ``` @@ -44,7 +52,7 @@ export const msToUnix = (ms: number): number => Number.parseInt(`${ms / 1000}`) * * @example * ```ts - * import { getNow } from 'jsr:@frytg/dates' + * import { getNow } from '@frytg/dates' * * getNow() * ``` @@ -52,13 +60,13 @@ export const msToUnix = (ms: number): number => Number.parseInt(`${ms / 1000}`) export const getNow = (): DateTime => DateTime.now() /** - * Provides util to get .unix() style value + * Get unix timestamp * @param {DateTime} [date] - date object * @returns {number} unix timestamp * * @example * ```ts - * import { getUnix } from 'jsr:@frytg/dates' + * import { getUnix } from '@frytg/dates' * * getUnix() * getUnix(getNow()) @@ -67,13 +75,13 @@ export const getNow = (): DateTime => DateTime.now() export const getUnix = (date?: DateTime): number => msToUnix((date || getNow()).valueOf()) /** - * Provides util to get ms timestamp + * Get ms (milliseconds) timestamp * @param {DateTime} [date] - date object * @returns {number} ms timestamp * * @example * ```ts - * import { getMs } from 'jsr:@frytg/dates' + * import { getMs } from '@frytg/dates' * * getMs() * getMs(getNow()) @@ -82,13 +90,13 @@ export const getUnix = (date?: DateTime): number => msToUnix((date || getNow()). export const getMs = (date?: DateTime): number => (date || getNow()).valueOf() /** - * Provides util to get ISO string in UTC timezone + * Get ISO string in UTC timezone * @param {DateTime} [date] - date object * @returns {string} ISO string * * @example * ```ts - * import { getISO } from 'jsr:@frytg/dates' + * import { getISO } from '@frytg/dates' * * getISO() * getISO(getNow()) @@ -110,7 +118,7 @@ export const getIso = getISO * * @example * ```ts - * import { getMsOffset } from 'jsr:@frytg/dates' + * import { getMsOffset } from '@frytg/dates' * * getMsOffset(getMs()) * ``` @@ -125,7 +133,7 @@ export const getMsOffset = (ms: number): number => getMs() - ms * * @example * ```ts - * import { getRelative } from 'jsr:@frytg/dates' + * import { getRelative } from '@frytg/dates' * * getRelative(getNow()) * getRelative(getNow(), 'nl-NL') @@ -141,7 +149,7 @@ export const getRelative = (date: DateTime, locale = 'en-US'): string => date.to * * @example * ```ts - * import { getYearMonthDay } from 'jsr:@frytg/dates' + * import { getYearMonthDay } from '@frytg/dates' * * getYearMonthDay(getNow()) // YYYYMMDD * getYearMonthDay(getNow(), true) // YYYY-MM-DD @@ -157,7 +165,7 @@ export const getYearMonthDay = (date?: DateTime, withDashes = false): string | n * * @example * ```ts - * import { parseISO } from 'jsr:@frytg/dates' + * import { parseISO } from '@frytg/dates' * * parseISO(getISO()) * parseISO('2024-11-23T10:00:00.000Z') @@ -179,7 +187,7 @@ export const parseIso = parseISO * * @example * ```ts - * import { getDateHourMinutes } from 'jsr:@frytg/dates' + * import { getDateHourMinutes } from '@frytg/dates' * * getDateHourMinutes(getNow()) * ``` @@ -194,7 +202,7 @@ export const getDateHourMinutes = (date: DateTime): string => * * @example * ```ts - * import { getFullRelativeTime } from 'jsr:@frytg/dates' + * import { getFullRelativeTime } from '@frytg/dates' * * getFullRelativeTime(getNow()) * ``` @@ -209,7 +217,7 @@ export const getFullRelativeTime = (date: DateTime): string => `${getDateHourMin * * @example * ```ts - * import { formatDuration } from 'jsr:@frytg/dates' + * import { formatDuration } from '@frytg/dates' * * formatDuration(1000) // 1s * diff --git a/dates/deno.jsonc b/dates/deno.jsonc index 220e5b4..5287040 100644 --- a/dates/deno.jsonc +++ b/dates/deno.jsonc @@ -1,7 +1,7 @@ { "$schema": "https://jsr.io/schema/config-file.v1.json", "name": "@frytg/dates", - "version": "0.1.0", + "version": "0.1.1", "exports": "./dates.ts", "imports": { "@std/fmt": "jsr:@std/fmt@^1.0.3", diff --git a/logger/deno.jsonc b/logger/deno.jsonc index bd35d5c..04ea039 100644 --- a/logger/deno.jsonc +++ b/logger/deno.jsonc @@ -5,5 +5,8 @@ "exports": "./logger.ts", "imports": { "winston": "npm:winston@^3.17.0" + }, + "publish": { + "exclude": ["*.test.ts"] } } diff --git a/logger/logger.ts b/logger/logger.ts index 7c4bffc..f597280 100644 --- a/logger/logger.ts +++ b/logger/logger.ts @@ -1,6 +1,7 @@ /** - * @module * A pre-configured logger that is ready to use with syslog levels. + * + * @module */ // load packages diff --git a/storage-s3/README.md b/storage-s3/README.md index c940021..045659f 100644 --- a/storage-s3/README.md +++ b/storage-s3/README.md @@ -13,7 +13,11 @@ import { getObject } from '@frytg/storage-s3'; const object = await getObject('path/to/object.json', { parseJson: true }); ``` -The MinIO client will be initialized with the required environment variables `STORE_S3_ENDPOINT`, `STORE_S3_ACCESS_KEY`, and `STORE_S3_SECRET_KEY`. +The MinIO client will be initialized with these required environment variables: + +- `STORE_S3_ENDPOINT` +- `STORE_S3_ACCESS_KEY` +- `STORE_S3_SECRET_KEY` ## Methods @@ -22,7 +26,8 @@ The MinIO client will be initialized with the required environment variables `ST - [objectExists](https://jsr.io/@frytg/storage-s3/doc/~/objectExists) - [listObjects](https://jsr.io/@frytg/storage-s3/doc/~/listObjects) -Also see all options in the [MinIO API documentation](https://min.io/docs/minio/linux/developers/javascript/API.html). They can be used by importing the `Client` object. +Also see all options in the [MinIO API documentation](https://min.io/docs/minio/linux/developers/javascript/API.html). +They can be used by importing the `Client` object. ## Author diff --git a/storage-s3/deno.jsonc b/storage-s3/deno.jsonc index edcb67e..0047695 100644 --- a/storage-s3/deno.jsonc +++ b/storage-s3/deno.jsonc @@ -5,5 +5,8 @@ "exports": "./storage.ts", "imports": { "minio": "npm:minio@^8.0.2" + }, + "publish": { + "exclude": ["*.test.ts"] } } diff --git a/storage-s3/storage.ts b/storage-s3/storage.ts index 269399d..98f73c3 100644 --- a/storage-s3/storage.ts +++ b/storage-s3/storage.ts @@ -2,8 +2,6 @@ * Storage module for S3 with common operations using MinIO. * * @module - * - * @see https://min.io/docs/minio/linux/developers/javascript/API.html */ // import packages