Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

nodejs/egg.js parse docx service

NotificationsYou must be signed in to change notification settings

Alex-Li2018/node-text-extraction--server

Repository files navigation

Docx reading Server, Easily generate.docx structure data with JS/TS. Works for Node.

structure data

{"code":200,"data": {"word_document": [            {// word内容"type":"documentPart","body": {},// 解析的是那个xml"path":"word/document.xml"             },            {// word扩展属性"type":"extendedPropsPart","props": {},"path":"docProps/app.xml"            },            {// word核心属性"type":"corePropsPart","props": {},"path":"docProps/core.xml"            },            {// 页眉"type":"footnotesPart","props": {},"path": {}            },            {// 页脚"type":"endnotesPart","props": {},"path": {}            },            {// 主题"type":"themePart","props": {},"path": {}            },        ],    },"msg":"success"}

document structure data

层级结构:    - document        - paragraph            - run                - text
{// word内容"type":"documentPart","body": {"type":"document","children": [            {"type":"paragraph","paragraph_text":"一、活动时间:3月15日","children": [                    {"type":"run","parent":null,"children": [                            {"type":"text","text":"一、活动时间:","id":79                            }                        ],"cssStyle": {"font-family":"微软雅黑 Light","font-weight":"bold"                        },"id":16,"parent_id":3                    },                    {"type":"run","parent":null,"children": [                            {"type":"text","text":"3月15日","id":79                            }                        ],"cssStyle": {"font-family":"微软雅黑 Light","font-weight":"bold"                        },"id":17,"parent_id":3                    }                ]            },            {"type":"paragraph","children": []            }        ]    },"path":"word/document.xml" },

service respond

detail

Relation

QuickStart

Development

$ npm i$ npm run dev$ open http://localhost:7001/

Don't tsc compile at development mode, if you had runtsc then you need tonpm run clean beforenpm run dev.

Deploy

physical machine

# ci$ npm run tsc$ npm start

Docker

Dockerfile

Npm Scripts

  • Usenpm run lint to check code style
  • Usenpm test to run unit test
  • senpm run clean to clean compiled js at development mode once

Requirement

  • Node.js 12.x
  • Typescript 2.8+

end

If you want to contribute code, please contactme(alexlismile@163.com) first.

About

nodejs/egg.js parse docx service

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

[8]ページ先頭

©2009-2025 Movatter.jp