@sv443-network/coreutils 1.0.0 → 2.0.0

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.
@@ -34,7 +34,7 @@ export type DataStoreOptions<TData extends DataStoreData> = Prettify<{
34
34
  * The engine middleware to use for persistent storage.
35
35
  * Create an instance of {@linkcode FileStorageEngine} (Node.js), {@linkcode BrowserStorageEngine} (DOM) or your own engine class that extends {@linkcode DataStoreEngine} and pass it here.
36
36
  *
37
- * ⚠️ Don't reuse the same engine instance for multiple DataStores, unless it explicitly supports it!
37
+ * - ⚠️ Don't reuse the same engine instance for multiple DataStores, unless it explicitly supports it!
38
38
  */
39
39
  engine: (() => DataStoreEngine<TData>) | DataStoreEngine<TData>;
40
40
  /**
@@ -57,26 +57,30 @@ export type DataStoreOptions<TData extends DataStoreData> = Prettify<{
57
57
  decodeData?: never;
58
58
  /**
59
59
  * The format to use for compressing the data. Defaults to `deflate-raw`. Explicitly set to `null` to store data uncompressed.
60
- * ⚠️ Use either this, or `encodeData` and `decodeData`, but not all three at a time!
60
+ * - ⚠️ Use either this property, or both `encodeData` and `decodeData`, but not all three!
61
61
  */
62
62
  compressionFormat?: CompressionFormat | null;
63
63
  } | {
64
64
  /**
65
65
  * Tuple of a compression format identifier and a function to use to encode the data prior to saving it in persistent storage.
66
- * If this is specified, `compressionFormat` can't be used. Also make sure to declare {@linkcode decodeData()} as well.
66
+ * Set the identifier to `null` or `"identity"` to indicate that no traditional compression is used.
67
+ *
68
+ * - ⚠️ If this is specified, `compressionFormat` can't be used. Also make sure to declare {@linkcode decodeData()} as well.
67
69
  *
68
70
  * You can make use of the [`compress()` function](https://github.com/Sv443-Network/CoreUtils/blob/main/docs.md#function-compress) here to make the data use up less space at the cost of a little bit of performance.
69
71
  * @param data The input data as a serialized object (JSON string)
70
72
  */
71
- encodeData: [format: LooseUnion<CompressionFormat>, encode: (data: string) => string | Promise<string>];
73
+ encodeData: [format: LooseUnion<CompressionFormat> | null, encode: (data: string) => string | Promise<string>];
72
74
  /**
73
75
  * Tuple of a compression format identifier and a function to use to decode the data after reading it from persistent storage.
74
- * If this is specified, `compressionFormat` can't be used. Also make sure to declare {@linkcode encodeData()} as well.
76
+ * Set the identifier to `null` or `"identity"` to indicate that no traditional compression is used.
77
+ *
78
+ * - ⚠️ If this is specified, `compressionFormat` can't be used. Also make sure to declare {@linkcode encodeData()} as well.
75
79
  *
76
80
  * You can make use of the [`decompress()` function](https://github.com/Sv443-Network/CoreUtils/blob/main/docs.md#function-decompress) here to make the data use up less space at the cost of a little bit of performance.
77
81
  * @returns The resulting data as a valid serialized object (JSON string)
78
82
  */
79
- decodeData: [format: LooseUnion<CompressionFormat>, decode: (data: string) => string | Promise<string>];
83
+ decodeData: [format: LooseUnion<CompressionFormat> | null, decode: (data: string) => string | Promise<string>];
80
84
  compressionFormat?: never;
81
85
  })>;
82
86
  /** Generic type that represents the serializable data structure saved in a {@linkcode DataStore} instance. */
@@ -100,9 +104,16 @@ export declare class DataStore<TData extends DataStoreData> {
100
104
  readonly defaultData: TData;
101
105
  readonly encodeData: DataStoreOptions<TData>["encodeData"];
102
106
  readonly decodeData: DataStoreOptions<TData>["decodeData"];
103
- readonly compressionFormat = "deflate-raw";
107
+ readonly compressionFormat: Exclude<DataStoreOptions<TData>["compressionFormat"], undefined>;
104
108
  readonly engine: DataStoreEngine<TData>;
109
+ options: DataStoreOptions<TData>;
110
+ /**
111
+ * Whether all first-init checks should be done.
112
+ * This includes migrating the internal DataStore format, migrating data from the UserUtils format, and anything similar.
113
+ * This is set to `true` by default. Create a subclass and set it to `false` before calling {@linkcode loadData()} if you want to explicitly skip these checks.
114
+ */
105
115
  protected firstInit: boolean;
116
+ /** In-memory cached copy of the data that is saved in persistent storage used for synchronous read access. */
106
117
  private cachedData;
107
118
  private migrations?;
108
119
  private migrateIds;
@@ -110,7 +121,6 @@ export declare class DataStore<TData extends DataStoreData> {
110
121
  * Creates an instance of DataStore to manage a sync & async database that is cached in memory and persistently saved across sessions.
111
122
  * Supports migrating data from older versions to newer ones and populating the cache with default data if no persistent data is found.
112
123
  *
113
- * - ⚠️ Requires the directives `@grant GM.getValue` and `@grant GM.setValue` if the storageMethod is left as the default of `"GM"`
114
124
  * - ⚠️ Make sure to call {@linkcode loadData()} at least once after creating an instance, or the returned data will be the same as `options.defaultData`
115
125
  *
116
126
  * @template TData The type of the data that is saved in persistent storage for the currently set format version (will be automatically inferred from `defaultData` if not provided) - **This has to be a JSON-compatible object!** (no undefined, circular references, etc.)
@@ -133,11 +143,9 @@ export declare class DataStore<TData extends DataStoreData> {
133
143
  /** Saves the default data passed in the constructor synchronously to the in-memory cache and asynchronously to persistent storage */
134
144
  saveDefaultData(): Promise<void>;
135
145
  /**
136
- * Call this method to clear all persistently stored data associated with this DataStore instance.
146
+ * Call this method to clear all persistently stored data associated with this DataStore instance, including the storage container (if supported by the DataStoreEngine).
137
147
  * The in-memory cache will be left untouched, so you may still access the data with {@linkcode getData()}
138
148
  * Calling {@linkcode loadData()} or {@linkcode setData()} after this method was called will recreate persistent storage with the cached or default data.
139
- *
140
- * - ⚠️ This requires the additional directive `@grant GM.deleteValue` if the storageMethod is left as the default of `"GM"`
141
149
  */
142
150
  deleteData(): Promise<void>;
143
151
  /** Returns whether encoding and decoding are enabled for this DataStore instance */
@@ -4,15 +4,22 @@
4
4
  * [See the documentation for more info.](https://github.com/Sv443-Network/CoreUtils/blob/main/docs.md#class-datastoreengine)
5
5
  */
6
6
  import type { DataStoreData, DataStoreOptions } from "./DataStore.js";
7
- import type { SerializableVal } from "./types.js";
7
+ import type { Prettify, SerializableVal } from "./types.js";
8
+ /** Contains the only properties of {@linkcode DataStoreOptions} that are relevant to the {@linkcode DataStoreEngine} class. */
9
+ export type DataStoreEngineDSOptions<TData extends DataStoreData> = Prettify<Pick<DataStoreOptions<TData>, "decodeData" | "encodeData" | "id">>;
10
+ export interface DataStoreEngine<TData extends DataStoreData> {
11
+ /** Deletes all data in persistent storage, including the data container itself (e.g. a file or a database) */
12
+ deleteStorage?(): Promise<void>;
13
+ }
8
14
  /**
9
15
  * Base class for creating {@linkcode DataStore} storage engines.
10
16
  * This acts as an interchangeable API for writing and reading persistent data in various environments.
11
17
  */
12
18
  export declare abstract class DataStoreEngine<TData extends DataStoreData> {
13
- protected dataStoreOptions: DataStoreOptions<TData>;
14
- /** Called by DataStore on creation, to pass its options */
15
- setDataStoreOptions(dataStoreOptions: DataStoreOptions<TData>): void;
19
+ protected dataStoreOptions: DataStoreEngineDSOptions<TData>;
20
+ constructor(options?: DataStoreEngineDSOptions<TData>);
21
+ /** Called by DataStore on creation, to pass its options. Only call this if you are using this instance standalone! */
22
+ setDataStoreOptions(dataStoreOptions: DataStoreEngineDSOptions<TData>): void;
16
23
  /** Fetches a value from persistent storage */
17
24
  abstract getValue<TValue extends SerializableVal = string>(name: string, defaultValue: TValue): Promise<string | TValue>;
18
25
  /** Sets a value in persistent storage */
@@ -23,6 +30,8 @@ export declare abstract class DataStoreEngine<TData extends DataStoreData> {
23
30
  serializeData(data: TData, useEncoding?: boolean): Promise<string>;
24
31
  /** Deserializes the given string to a JSON object, optionally decoded with `options.decodeData` if {@linkcode useEncoding} is set to true */
25
32
  deserializeData(data: string, useEncoding?: boolean): Promise<TData>;
33
+ /** Throws an error if the DataStoreOptions are not set or invalid */
34
+ protected ensureDataStoreOptions(): void;
26
35
  /**
27
36
  * Copies a JSON-compatible object and loses all its internal references in the process.
28
37
  * Uses [`structuredClone()`](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) if available, otherwise falls back to `JSON.parse(JSON.stringify(obj))`.
@@ -33,20 +42,25 @@ export declare abstract class DataStoreEngine<TData extends DataStoreData> {
33
42
  export type BrowserStorageEngineOptions = {
34
43
  /** Whether to store the data in LocalStorage (default) or SessionStorage */
35
44
  type?: "localStorage" | "sessionStorage";
45
+ /**
46
+ * Specifies the necessary options for storing data.
47
+ * - ⚠️ Only specify this if you are using this instance standalone! The parent DataStore will set this automatically.
48
+ */
49
+ dataStoreOptions?: DataStoreEngineDSOptions<DataStoreData>;
36
50
  };
37
51
  /**
38
52
  * Storage engine for the {@linkcode DataStore} class that uses the browser's LocalStorage or SessionStorage to store data.
39
53
  *
40
- * ⚠️ Requires a DOM environment
41
- * ⚠️ Don't reuse this engine across multiple {@linkcode DataStore} instances
54
+ * - ⚠️ Requires a DOM environment
55
+ * - ⚠️ Don't reuse engines across multiple {@linkcode DataStore} instances
42
56
  */
43
57
  export declare class BrowserStorageEngine<TData extends DataStoreData> extends DataStoreEngine<TData> {
44
- protected options: Required<BrowserStorageEngineOptions>;
58
+ protected options: BrowserStorageEngineOptions & Required<Pick<BrowserStorageEngineOptions, "type">>;
45
59
  /**
46
60
  * Creates an instance of `BrowserStorageEngine`.
47
61
  *
48
- * ⚠️ Requires a DOM environment
49
- * ⚠️ Don't reuse this engine across multiple {@linkcode DataStore} instances
62
+ * - ⚠️ Requires a DOM environment
63
+ * - ⚠️ Don't reuse engines across multiple {@linkcode DataStore} instances
50
64
  */
51
65
  constructor(options?: BrowserStorageEngineOptions);
52
66
  /** Fetches a value from persistent storage */
@@ -60,20 +74,25 @@ export declare class BrowserStorageEngine<TData extends DataStoreData> extends D
60
74
  export type FileStorageEngineOptions = {
61
75
  /** Function that returns a string or a plain string that is the data file path, including name and extension. Defaults to `.ds-${dataStoreID}` */
62
76
  filePath?: ((dataStoreID: string) => string) | string;
77
+ /**
78
+ * Specifies the necessary options for storing data.
79
+ * - ⚠️ Only specify this if you are using this instance standalone! The parent DataStore will set this automatically.
80
+ */
81
+ dataStoreOptions?: DataStoreEngineDSOptions<DataStoreData>;
63
82
  };
64
83
  /**
65
84
  * Storage engine for the {@linkcode DataStore} class that uses a JSON file to store data.
66
85
  *
67
- * ⚠️ Requires Node.js or Deno with Node compatibility (v1.31+)
68
- * ⚠️ Don't reuse this engine across multiple {@linkcode DataStore} instances
86
+ * - ⚠️ Requires Node.js or Deno with Node compatibility (v1.31+)
87
+ * - ⚠️ Don't reuse engines across multiple {@linkcode DataStore} instances
69
88
  */
70
89
  export declare class FileStorageEngine<TData extends DataStoreData> extends DataStoreEngine<TData> {
71
- protected options: Required<FileStorageEngineOptions>;
90
+ protected options: FileStorageEngineOptions & Required<Pick<FileStorageEngineOptions, "filePath">>;
72
91
  /**
73
92
  * Creates an instance of `FileStorageEngine`.
74
93
  *
75
- * ⚠️ Requires Node.js or Deno with Node compatibility (v1.31+)
76
- * ⚠️ Don't reuse this engine across multiple {@linkcode DataStore} instances
94
+ * - ⚠️ Requires Node.js or Deno with Node compatibility (v1.31+)
95
+ * - ⚠️ Don't reuse engines across multiple {@linkcode DataStore} instances
77
96
  */
78
97
  constructor(options?: FileStorageEngineOptions);
79
98
  /** Reads the file contents */
@@ -86,4 +105,6 @@ export declare class FileStorageEngine<TData extends DataStoreData> extends Data
86
105
  setValue<TValue extends SerializableVal = string>(name: string, value: TValue): Promise<void>;
87
106
  /** Deletes a value from persistent storage */
88
107
  deleteValue(name: string): Promise<void>;
108
+ /** Deletes the file that contains the data of this DataStore. */
109
+ deleteStorage(): Promise<void>;
89
110
  }
@@ -3,10 +3,26 @@
3
3
  * This module contains the NanoEmitter class, which is a tiny event emitter powered by [nanoevents](https://www.npmjs.com/package/nanoevents) - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#nanoemitter)
4
4
  */
5
5
  import { type DefaultEvents, type Emitter, type EventsMap, type Unsubscribe } from "nanoevents";
6
+ import type { Prettify } from "./types.js";
6
7
  export interface NanoEmitterOptions {
7
8
  /** If set to true, allows emitting events through the public method emit() */
8
9
  publicEmit: boolean;
9
10
  }
11
+ type NanoEmitterOnMultiTriggerOptions<TEvtMap extends EventsMap, TKey extends keyof TEvtMap = keyof TEvtMap> = {
12
+ /** Calls the callback when one of the given events is emitted */
13
+ oneOf?: TKey[];
14
+ /** Calls the callback when all of the given events are emitted */
15
+ allOf?: TKey[];
16
+ };
17
+ /** Options for the {@linkcode NanoEmitter.onMulti()} method */
18
+ export type NanoEmitterOnMultiOptions<TEvtMap extends EventsMap, TKey extends keyof TEvtMap = keyof TEvtMap> = Prettify<{
19
+ /** If true, the callback will be called only once for the first event (or set of events) that match the criteria */
20
+ once?: boolean;
21
+ /** If provided, can be used to abort the subscription if the signal is aborted */
22
+ signal?: AbortSignal;
23
+ /** The callback to call when the event with the given name is emitted */
24
+ callback: (event: TKey, ...args: Parameters<TEvtMap[TKey]>) => void;
25
+ } & NanoEmitterOnMultiTriggerOptions<TEvtMap, TKey> & (Pick<Required<NanoEmitterOnMultiTriggerOptions<TEvtMap, TKey>>, "oneOf"> | Pick<Required<NanoEmitterOnMultiTriggerOptions<TEvtMap, TKey>>, "allOf">)>;
10
26
  /**
11
27
  * Class that can be extended or instantiated by itself to create a lightweight event emitter with helper methods and a strongly typed event map.
12
28
  * If extended from, you can use `this.events.emit()` to emit events, even if the `emit()` method doesn't work because `publicEmit` is not set to true in the constructor.
@@ -58,9 +74,24 @@ export declare class NanoEmitter<TEvtMap extends EventsMap = DefaultEvents> {
58
74
  * ```
59
75
  */
60
76
  once<TKey extends keyof TEvtMap>(event: TKey | "_", cb?: TEvtMap[TKey]): Promise<Parameters<TEvtMap[TKey]>>;
77
+ /**
78
+ * Allows subscribing to multiple events and calling the callback only when one of, all of, or a subset of the events are emitted, either continuously or only once.
79
+ * @param options An object or array of objects with the following properties:
80
+ * `callback` (required) is the function that will be called when the conditions are met.
81
+ *
82
+ * Set `once` to true to call the callback only once for the first event (or set of events) that match the criteria, then stop listening.
83
+ * If `signal` is provided, the subscription will be aborted when the given signal is aborted.
84
+ *
85
+ * If `oneOf` is used, the callback will be called when any of the matching events are emitted.
86
+ * If `allOf` is used, the callback will be called after all of the matching events are emitted at least once, then any time any of them are emitted.
87
+ * You may use a combination of the above two options, but at least one of them must be provided.
88
+ *
89
+ * @returns Returns a function that can be called to unsubscribe all listeners created by this call. Alternatively, pass an `AbortSignal` to all options objects to achieve the same effect or for finer control.
90
+ */
91
+ onMulti<TEvt extends keyof TEvtMap>(options: NanoEmitterOnMultiOptions<TEvtMap> | Array<NanoEmitterOnMultiOptions<TEvtMap>>): Unsubscribe;
61
92
  /**
62
93
  * Emits an event on this instance.
63
- * ⚠️ Needs `publicEmit` to be set to true in the NanoEmitter constructor or super() call!
94
+ * - ⚠️ Needs `publicEmit` to be set to true in the NanoEmitter constructor or super() call!
64
95
  * @param event The event to emit
65
96
  * @param args The arguments to pass to the event listeners
66
97
  * @returns Returns true if `publicEmit` is true and the event was emitted successfully
@@ -69,3 +100,4 @@ export declare class NanoEmitter<TEvtMap extends EventsMap = DefaultEvents> {
69
100
  /** Unsubscribes all event listeners from this instance */
70
101
  unsubscribeAll(): void;
71
102
  }
103
+ export {};
@@ -46,7 +46,7 @@ export type TieredCacheTierOptions<TData extends DataStoreData> = Prettify<{
46
46
  /**
47
47
  * Engine used for persistent storage. Can be a function that returns a DataStoreEngine or a DataStoreEngine instance.
48
48
  * If this property is not set, this tier will not persist data and only keeps it in memory.
49
- * ⚠️ **Don't reuse instances in multiple tiers and make sure the ID is always unique!**
49
+ * - ⚠️ **Don't reuse instances in multiple tiers and make sure the ID is always unique!**
50
50
  */
51
51
  engine?: (() => DataStoreEngine<TData>) | DataStoreEngine<TData>;
52
52
  /** Which compression format to use for this tier's persistent storage. Defaults to `deflate-raw` - set to `null` to disable compression. */
@@ -1,27 +1,27 @@
1
1
  /**
2
2
  * @module crypto
3
- * This module contains various cryptographic functions, like compression and ArrayBuffer encoding - [see the documentation for more info](https://github.com/Sv443-Network/CoreUtils/blob/main/docs.md#crypto)
3
+ * This module contains various cryptographic functions, like compression and Uint8Array encoding - [see the documentation for more info](https://github.com/Sv443-Network/CoreUtils/blob/main/docs.md#crypto)
4
4
  */
5
5
  import type { Stringifiable } from "./types.js";
6
- /** Converts an ArrayBuffer to a base64-encoded (ASCII) string */
7
- export declare function abtoa(buf: ArrayBuffer): string;
8
- /** Converts a base64-encoded (ASCII) string to an ArrayBuffer representation of its bytes */
9
- export declare function atoab(str: string): ArrayBuffer;
10
- /** Compresses a string or an ArrayBuffer using the provided {@linkcode compressionFormat} and returns it as a base64 string */
11
- export declare function compress(input: Stringifiable | ArrayBuffer, compressionFormat: CompressionFormat, outputType?: "string"): Promise<string>;
12
- /** Compresses a string or an ArrayBuffer using the provided {@linkcode compressionFormat} and returns it as an ArrayBuffer */
13
- export declare function compress(input: Stringifiable | ArrayBuffer, compressionFormat: CompressionFormat, outputType: "arrayBuffer"): Promise<ArrayBuffer>;
14
- /** Decompresses a previously compressed base64 string or ArrayBuffer, with the format passed by {@linkcode compressionFormat}, converted to a string */
15
- export declare function decompress(input: Stringifiable | ArrayBuffer, compressionFormat: CompressionFormat, outputType?: "string"): Promise<string>;
16
- /** Decompresses a previously compressed base64 string or ArrayBuffer, with the format passed by {@linkcode compressionFormat}, converted to an ArrayBuffer */
17
- export declare function decompress(input: Stringifiable | ArrayBuffer, compressionFormat: CompressionFormat, outputType: "arrayBuffer"): Promise<ArrayBuffer>;
6
+ /** Converts an Uint8Array to a base64-encoded (ASCII) string */
7
+ export declare function abtoa(buf: Uint8Array): string;
8
+ /** Converts a base64-encoded (ASCII) string to an Uint8Array representation of its bytes */
9
+ export declare function atoab(str: string): Uint8Array;
10
+ /** Compresses a string or an Uint8Array using the provided {@linkcode compressionFormat} and returns it as a base64 string */
11
+ export declare function compress(input: Stringifiable | Uint8Array, compressionFormat: CompressionFormat, outputType?: "string"): Promise<string>;
12
+ /** Compresses a string or an Uint8Array using the provided {@linkcode compressionFormat} and returns it as an Uint8Array */
13
+ export declare function compress(input: Stringifiable | Uint8Array, compressionFormat: CompressionFormat, outputType: "arrayBuffer"): Promise<Uint8Array>;
14
+ /** Decompresses a previously compressed base64 string or Uint8Array, with the format passed by {@linkcode compressionFormat}, converted to a string */
15
+ export declare function decompress(input: Stringifiable | Uint8Array, compressionFormat: CompressionFormat, outputType?: "string"): Promise<string>;
16
+ /** Decompresses a previously compressed base64 string or Uint8Array, with the format passed by {@linkcode compressionFormat}, converted to an Uint8Array */
17
+ export declare function decompress(input: Stringifiable | Uint8Array, compressionFormat: CompressionFormat, outputType: "arrayBuffer"): Promise<Uint8Array>;
18
18
  /**
19
- * Creates a hash / checksum of the given {@linkcode input} string or ArrayBuffer using the specified {@linkcode algorithm} ("SHA-256" by default).
19
+ * Creates a hash / checksum of the given {@linkcode input} string or Uint8Array using the specified {@linkcode algorithm} ("SHA-256" by default).
20
20
  *
21
21
  * - ⚠️ Uses the SubtleCrypto API so it needs to run in a secure context (HTTPS).
22
22
  * - ⚠️ If you use this for cryptography, make sure to use a secure algorithm (under no circumstances use SHA-1) and to [salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) your input data.
23
23
  */
24
- export declare function computeHash(input: string | ArrayBuffer, algorithm?: string): Promise<string>;
24
+ export declare function computeHash(input: string | Uint8Array, algorithm?: string): Promise<string>;
25
25
  /**
26
26
  * Generates a random ID with the specified length and radix (16 characters and hexadecimal by default)
27
27
  *
@@ -35,6 +35,10 @@ export declare function mapRange(value: number, range1min: number, range1max: nu
35
35
  * For example, you can map the value 2 in the range of 0-5 to the range of 0-10 and you'd get a 4 as a result.
36
36
  */
37
37
  export declare function mapRange(value: number, range1max: number, range2max: number): number;
38
+ /** Makes the {@linkcode value} over- & underflow so it is always between {@linkcode min} and {@linkcode max}, if it's outside the range */
39
+ export declare function overflowVal(value: number, min: number, max: number): number;
40
+ /** Makes the {@linkcode value} over- & underflow so it is always between `0` and {@linkcode max}, if it's outside the range */
41
+ export declare function overflowVal(value: number, max: number): number;
38
42
  /**
39
43
  * Returns a random number between {@linkcode min} and {@linkcode max} (inclusive)
40
44
  * Set {@linkcode enhancedEntropy} to true to use `crypto.getRandomValues()` for better cryptographic randomness (this also makes it take longer to generate)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sv443-network/coreutils",
3
3
  "libName": "@sv443-network/coreutils",
4
- "version": "1.0.0",
4
+ "version": "2.0.0",
5
5
  "description": "Cross-platform, general-purpose, JavaScript core library for Node, Deno and the browser. Intended to be used in conjunction with `@sv443-network/userutils` and `@sv443-network/djsutils`, but can be used independently as well.",
6
6
  "main": "dist/CoreUtils.cjs",
7
7
  "module": "dist/CoreUtils.mjs",
@@ -85,6 +85,7 @@
85
85
  "publish-package": "changeset publish",
86
86
  "publish-package-jsr": "pnpm update-jsr-version && npx jsr publish --allow-dirty",
87
87
  "check-jsr": "pnpm update-jsr-version && npx jsr publish --allow-dirty --dry-run",
88
+ "check-npm": "npm publish --dry-run",
88
89
  "change": "changeset",
89
90
  "test": "vitest",
90
91
  "test-coverage": "vitest --coverage"