hwpx-js 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 +5 -5
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# hwpx
|
|
1
|
+
# hwpx-js
|
|
2
2
|
|
|
3
3
|
한글(Hancom) 워드프로세서의 HWPX/HWP 문서를 읽고 쓰는 JavaScript 라이브러리.
|
|
4
4
|
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
## 설치
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install hwpx
|
|
16
|
+
npm install hwpx-js
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## 문서 생성
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { writeFileSync } from 'fs';
|
|
23
|
-
import { write, HWPXBuilder } from 'hwpx';
|
|
23
|
+
import { write, HWPXBuilder } from 'hwpx-js';
|
|
24
24
|
|
|
25
25
|
const doc = new HWPXBuilder()
|
|
26
26
|
.addParagraph('제목', { fontSize: 20, bold: true })
|
|
@@ -39,7 +39,7 @@ writeFileSync('output.hwpx', write(doc));
|
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
41
|
import { readFileSync } from 'fs';
|
|
42
|
-
import { read } from 'hwpx';
|
|
42
|
+
import { read } from 'hwpx-js';
|
|
43
43
|
|
|
44
44
|
// .hwpx / .hwp 자동 감지
|
|
45
45
|
const doc = read(new Uint8Array(readFileSync('document.hwpx')));
|
|
@@ -124,7 +124,7 @@ builder
|
|
|
124
124
|
## 유틸리티
|
|
125
125
|
|
|
126
126
|
```typescript
|
|
127
|
-
import { utils } from 'hwpx';
|
|
127
|
+
import { utils } from 'hwpx-js';
|
|
128
128
|
|
|
129
129
|
utils.mmToHwpunit(210); // mm → HWPUNIT (1/7200 inch)
|
|
130
130
|
utils.hwpunitToMm(59528); // HWPUNIT → mm
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hwpx-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Read and write HWPX/HWP documents — the Korean word processor format by Hancom",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -41,6 +41,14 @@
|
|
|
41
41
|
"document",
|
|
42
42
|
"word-processor"
|
|
43
43
|
],
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/babpulss/hwpx-js.git"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/babpulss/hwpx-js#readme",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/babpulss/hwpx-js/issues"
|
|
51
|
+
},
|
|
44
52
|
"author": "babpulss",
|
|
45
53
|
"license": "Apache-2.0",
|
|
46
54
|
"dependencies": {
|