GithubHelp home page GithubHelp logo

qaison / xmindparser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xieguanhua/xmindparser

0.0 0.0 0.0 1.04 MB

xmind转百度脑图json格式与百度脑图json转xmind,支持浏览器与node

License: MIT License

JavaScript 100.00%

xmindparser's Introduction

xmindparser

一个简单的javascript模块,用于Xmind 双向格式转换

安装

使用(npm)源安装,npm install xmindparser

可用脚本

npm run test

运行测试程序.
See the section about running tests for more information.

快速开始

xmind转json

const xmindparser = require('xmindparser');
let parser = new xmindparser()
//xmind转脑图 json 支持二进制文件或url和本地目录
const fileOrPath = 'test.xmind' 
parser.xmindToJSON(fileOrPath).then(json => {
    console.log(json)
})

json转xmind

const xmindparser = require('xmindparser');
let parser = new xmindparser()
const json = {
   "template": "default",
   "theme": "fresh-blue",
   "root": {
       "data": {"text": "中心主题", "note": "", "imageSize": {}},
       "children": [{
           "children": [{"children": [], "data": {"text": "新建节点", "note": "", "imageSize": {}}}],
           "data": {"text": "新建节点", "note": "", "imageSize": {}}
       }, {
           "children": [{"children": [], "data": {"text": "新建节点", "note": "", "imageSize": {}}}],
           "data": {"text": "新建节点", "note": "", "imageSize": {}}
       }, {"children": [], "data": {"text": "新建节点", "note": "", "imageSize": {}}}, {
           "children": [],
           "data": {"text": "新建节点", "note": "", "imageSize": {}}
       }, {"children": [], "data": {"text": "新建节点", "note": "", "imageSize": {}}}, {
           "children": [],
           "data": {"text": "新建节点", "note": "", "imageSize": {}}
       }]
   }
}

//脑图 json转xmind 浏览器返回blob node返回pathurl
const fileOrPath = 'test.xmind' 
parser.JSONToXmind(json,outputPath).then(data => {
    console.log(data)
})

Methods

.xmindToJSON(params)

Name Type Default Required
params (path,url,buffer,blob) - Y

.JSONToXmind(json,outputPath)

Name Type Default Required
json (object) - Y
outputPath string path.join(__dirname, '../') node:Y

xmindparser's People

Contributors

xieguanhua avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.