@utilix-tech/sdk 0.1.0 → 0.1.1
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 +46 -50
- package/package.json +1 -8
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# @utilix/sdk
|
|
1
|
+
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
3
|
**100+ developer utility tools that run entirely in Node.js — no API key, no internet required.**
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@utilix/sdk)
|
|
6
|
-
[](https://www.npmjs.com/package/@utilix/sdk)
|
|
7
|
-
[](https://nodejs.org)
|
|
5
|
+
[](https://www.npmjs.com/package/@utilix-tech/sdk)
|
|
6
|
+
[](https://www.npmjs.com/package/@utilix-tech/sdk)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
|
|
10
10
|
The same tools available at [utilix.tech](https://utilix.tech), packaged for local use in your Node.js projects. Works offline, ships zero runtime secrets, and is fully tree-shakeable via subpath imports.
|
|
@@ -14,15 +14,15 @@ The same tools available at [utilix.tech](https://utilix.tech), packaged for loc
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install @utilix/sdk
|
|
17
|
+
npm install @utilix-tech/sdk
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
yarn add @utilix/sdk
|
|
21
|
+
yarn add @utilix-tech/sdk
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
pnpm add @utilix/sdk
|
|
25
|
+
pnpm add @utilix-tech/sdk
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
---
|
|
@@ -34,7 +34,7 @@ Each module is available as a dedicated subpath import so your bundler only pull
|
|
|
34
34
|
### Format JSON
|
|
35
35
|
|
|
36
36
|
```js
|
|
37
|
-
import { formatJson } from "@utilix/sdk/json";
|
|
37
|
+
import { formatJson } from "@utilix-tech/sdk/json";
|
|
38
38
|
|
|
39
39
|
const pretty = formatJson('{"name":"alice","age":30}', { indent: 2 });
|
|
40
40
|
console.log(pretty);
|
|
@@ -47,16 +47,16 @@ console.log(pretty);
|
|
|
47
47
|
### Encode / Decode Base64
|
|
48
48
|
|
|
49
49
|
```js
|
|
50
|
-
import { encodeBase64 } from "@utilix/sdk/encoding";
|
|
50
|
+
import { encodeBase64 } from "@utilix-tech/sdk/encoding";
|
|
51
51
|
|
|
52
52
|
const encoded = encodeBase64("Hello, World!");
|
|
53
53
|
console.log(encoded); // SGVsbG8sIFdvcmxkIQ==
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
### Hash a Value
|
|
56
|
+
### Hash a Value
|
|
57
57
|
|
|
58
58
|
```js
|
|
59
|
-
import { hashAll } from "@utilix/sdk/hashing";
|
|
59
|
+
import { hashAll } from "@utilix-tech/sdk/hashing";
|
|
60
60
|
|
|
61
61
|
const results = await hashAll("my-secret-string");
|
|
62
62
|
console.log(results);
|
|
@@ -66,7 +66,7 @@ console.log(results);
|
|
|
66
66
|
### Convert Color Formats
|
|
67
67
|
|
|
68
68
|
```js
|
|
69
|
-
import { convertColor } from "@utilix/sdk/color";
|
|
69
|
+
import { convertColor } from "@utilix-tech/sdk/color";
|
|
70
70
|
|
|
71
71
|
const result = convertColor("#1a2b3c");
|
|
72
72
|
console.log(result);
|
|
@@ -76,7 +76,7 @@ console.log(result);
|
|
|
76
76
|
### Build a cURL Command
|
|
77
77
|
|
|
78
78
|
```js
|
|
79
|
-
import { buildCurlCommand } from "@utilix/sdk/api";
|
|
79
|
+
import { buildCurlCommand } from "@utilix-tech/sdk/api";
|
|
80
80
|
|
|
81
81
|
const curl = buildCurlCommand({
|
|
82
82
|
method: "POST",
|
|
@@ -93,28 +93,28 @@ console.log(curl);
|
|
|
93
93
|
### Generate a UUID
|
|
94
94
|
|
|
95
95
|
```js
|
|
96
|
-
import { generateUuid } from "@utilix/sdk/generators";
|
|
96
|
+
import { generateUuid } from "@utilix-tech/sdk/generators";
|
|
97
97
|
|
|
98
98
|
const id = generateUuid();
|
|
99
99
|
console.log(id); // e.g. "f47ac10b-58cc-4372-a567-0e02b2c3d479"
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
###
|
|
102
|
+
### Format SQL
|
|
103
103
|
|
|
104
104
|
```js
|
|
105
|
-
import {
|
|
105
|
+
import { formatSql } from "@utilix-tech/sdk/code";
|
|
106
106
|
|
|
107
|
-
const
|
|
108
|
-
console.log(
|
|
107
|
+
const formatted = formatSql("SELECT id,name FROM users WHERE active=1");
|
|
108
|
+
console.log(formatted);
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
###
|
|
111
|
+
### Convert Units
|
|
112
112
|
|
|
113
113
|
```js
|
|
114
|
-
import {
|
|
114
|
+
import { convertLength } from "@utilix-tech/sdk/units";
|
|
115
115
|
|
|
116
|
-
const
|
|
117
|
-
console.log(
|
|
116
|
+
const result = convertLength(100, "cm", "in");
|
|
117
|
+
console.log(result); // 39.37
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
---
|
|
@@ -125,69 +125,65 @@ All 14 subpath modules and what they cover:
|
|
|
125
125
|
|
|
126
126
|
| Subpath | Description |
|
|
127
127
|
|---|---|
|
|
128
|
-
| `@utilix/sdk/json` | Format, minify, validate, sort keys, and
|
|
129
|
-
| `@utilix/sdk/encoding` | Base64, URL, HTML, hex, and binary encode/decode |
|
|
130
|
-
| `@utilix/sdk/hashing` | MD5, SHA-1, SHA-256, SHA-512, bcrypt, and HMAC
|
|
131
|
-
| `@utilix/sdk/
|
|
132
|
-
| `@utilix/sdk/
|
|
133
|
-
| `@utilix/sdk/generators` | UUID v4/v7, nanoid, random strings, passwords, and lorem ipsum |
|
|
134
|
-
| `@utilix/sdk/
|
|
135
|
-
| `@utilix/sdk/
|
|
136
|
-
| `@utilix/sdk/
|
|
137
|
-
| `@utilix/sdk/
|
|
138
|
-
| `@utilix/sdk/
|
|
139
|
-
| `@utilix/sdk/
|
|
140
|
-
| `@utilix/sdk/
|
|
141
|
-
| `@utilix/sdk/
|
|
128
|
+
| `@utilix-tech/sdk/json` | Format, minify, validate, sort keys, and query JSON documents |
|
|
129
|
+
| `@utilix-tech/sdk/encoding` | Base64, URL, HTML, hex, and binary encode/decode |
|
|
130
|
+
| `@utilix-tech/sdk/hashing` | MD5, SHA-1, SHA-256, SHA-512, bcrypt, and HMAC |
|
|
131
|
+
| `@utilix-tech/sdk/text` | Case conversion, slugify, truncate, word count, and string transforms |
|
|
132
|
+
| `@utilix-tech/sdk/data` | CSV/YAML/TOML/XML parse and convert, JSON diff and merge |
|
|
133
|
+
| `@utilix-tech/sdk/generators` | UUID v4/v7, nanoid, random strings, passwords, and lorem ipsum |
|
|
134
|
+
| `@utilix-tech/sdk/time` | Parse, format, and calculate durations; cron expression helpers |
|
|
135
|
+
| `@utilix-tech/sdk/units` | Convert length, weight, temperature, speed, area, volume, and more |
|
|
136
|
+
| `@utilix-tech/sdk/network` | Parse URLs, query strings, IP addresses, and CIDR ranges |
|
|
137
|
+
| `@utilix-tech/sdk/api` | Build cURL commands, parse HTTP headers, validate OpenAPI specs |
|
|
138
|
+
| `@utilix-tech/sdk/code` | Format SQL, minify JS/CSS, detect language, evaluate math expressions |
|
|
139
|
+
| `@utilix-tech/sdk/color` | Convert between hex, RGB, HSL, HSV, CMYK; generate palettes |
|
|
140
|
+
| `@utilix-tech/sdk/css` | Parse, minify, and format CSS; extract variables and rules |
|
|
141
|
+
| `@utilix-tech/sdk/misc` | QR code generation, markdown conversion, semver comparison |
|
|
142
142
|
|
|
143
143
|
---
|
|
144
144
|
|
|
145
145
|
## Node.js SDK vs Python SDK
|
|
146
146
|
|
|
147
|
-
`@utilix/sdk` is the Node.js companion to [`utilix-sdk`](https://pypi.org/project/utilix-sdk/) on PyPI. Both SDKs expose the same 100+ tools and return identically shaped results
|
|
147
|
+
`@utilix-tech/sdk` is the Node.js companion to [`utilix-sdk`](https://pypi.org/project/utilix-sdk/) on PyPI. Both SDKs expose the same 100+ tools and return identically shaped results.
|
|
148
148
|
|
|
149
149
|
| | Node.js | Python |
|
|
150
150
|
|---|---|---|
|
|
151
|
-
| Install | `npm install @utilix/sdk` | `pip install utilix-sdk` |
|
|
152
|
-
| Import style |
|
|
153
|
-
| Tree-shaking | Yes — only
|
|
154
|
-
| Async tools | `async/await` (e.g. `hashAll`) | `async def` / `asyncio` equivalents |
|
|
151
|
+
| Install | `npm install @utilix-tech/sdk` | `pip install utilix-sdk` |
|
|
152
|
+
| Import style | `import { fn } from "@utilix-tech/sdk/json"` | `from utilix.tools.json_tools import fn` |
|
|
153
|
+
| Tree-shaking | Yes — subpath imports only bundle what you use | Not applicable |
|
|
155
154
|
| Return shapes | Identical JSON-serializable objects | Identical JSON-serializable dicts |
|
|
156
155
|
| Runtime | Node 18+ | Python 3.9+ |
|
|
157
156
|
|
|
158
|
-
Subpath imports are a deliberate design choice for Node.js: they allow bundlers (webpack, esbuild, Rollup, Vite) to eliminate any modules you do not use, keeping your bundle size minimal.
|
|
159
|
-
|
|
160
157
|
---
|
|
161
158
|
|
|
162
159
|
## Surface A (Local) vs Surface B (REST API)
|
|
163
160
|
|
|
164
161
|
### Surface A — Local (this package)
|
|
165
162
|
|
|
166
|
-
`@utilix/sdk` is **Surface A**: everything runs in-process, in your Node.js runtime. No outbound network requests are made.
|
|
163
|
+
`@utilix-tech/sdk` is **Surface A**: everything runs in-process, in your Node.js runtime. No outbound network requests are made. Ideal for:
|
|
167
164
|
|
|
168
165
|
- CI pipelines and build scripts
|
|
169
166
|
- CLI tools and developer tooling
|
|
170
167
|
- Server-side Node.js applications
|
|
171
168
|
- Offline or air-gapped environments
|
|
172
|
-
- Use cases where you cannot send data to an external service
|
|
173
169
|
|
|
174
170
|
### Surface B — REST API (coming soon)
|
|
175
171
|
|
|
176
|
-
**Surface B** is a language-agnostic REST API hosted at `api.utilix.tech`. It exposes the same tools over HTTP so any language or environment can call them with a single `fetch`.
|
|
172
|
+
**Surface B** is a language-agnostic REST API hosted at `api.utilix.tech`. It exposes the same tools over HTTP so any language or environment can call them with a single `fetch`. Currently in development — follow [utilix.tech](https://utilix.tech) for announcements.
|
|
177
173
|
|
|
178
174
|
---
|
|
179
175
|
|
|
180
176
|
## Requirements
|
|
181
177
|
|
|
182
|
-
- **Node.js 18 or later** —
|
|
183
|
-
- **ESM and CommonJS both supported** — the package ships dual exports.
|
|
178
|
+
- **Node.js 18 or later** — uses the built-in `crypto` module APIs stabilized in Node 18.
|
|
179
|
+
- **ESM and CommonJS both supported** — the package ships dual exports.
|
|
184
180
|
|
|
185
181
|
```js
|
|
186
182
|
// ESM
|
|
187
|
-
import { formatJson } from "@utilix/sdk/json";
|
|
183
|
+
import { formatJson } from "@utilix-tech/sdk/json";
|
|
188
184
|
|
|
189
185
|
// CommonJS
|
|
190
|
-
const { formatJson } = require("@utilix/sdk/json");
|
|
186
|
+
const { formatJson } = require("@utilix-tech/sdk/json");
|
|
191
187
|
```
|
|
192
188
|
|
|
193
189
|
TypeScript types are included — no `@types/` package needed.
|
package/package.json
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "100+ developer utility tools for Node.js — JSON, encoding, hashing, color, CSS, network and more. Runs locally, no API key required.",
|
|
5
5
|
"author": "Utilix <hello@utilix.tech>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://utilix.tech",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/utilix-tech/utilix-sdk-node"
|
|
11
|
-
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/utilix-tech/utilix-sdk-node/issues"
|
|
14
|
-
},
|
|
15
8
|
"keywords": [
|
|
16
9
|
"developer-tools",
|
|
17
10
|
"utilities",
|