einsteinjs 0.1.1 → 0.1.2
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 +34 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# EinsteinJS
|
|
2
|
+
|
|
3
|
+
A type-safe snippet registry and compiler for VSCode and Cursor.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add einsteinjs
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { registry, build } from "einsteinjs"
|
|
15
|
+
|
|
16
|
+
const rfc = registry
|
|
17
|
+
.it("React Functional Component")
|
|
18
|
+
.scope(["typescriptreact"])
|
|
19
|
+
.prefix("rfc")
|
|
20
|
+
.body([
|
|
21
|
+
"export default function ${1:Component}() {",
|
|
22
|
+
" return <div>$0</div>",
|
|
23
|
+
"}"
|
|
24
|
+
])
|
|
25
|
+
.tag(["react"])
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- Type-safe API
|
|
31
|
+
- Duplicate prefix validation
|
|
32
|
+
- Duplicate name validation
|
|
33
|
+
- VSCode-compatible output
|
|
34
|
+
- Extensible compiler architecture
|