New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

docx4js

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docx4js

javascript docx parser

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.8K
increased by7.38%
Maintainers
1
Weekly downloads
 
Created
Source

#docx4js a javascript docx parser

#install $ npm install docx4js

#API

	<script src="../dist/docx4js.js"></script>
	<script>
		var Text=(function(){
			var converter=[]
			converter.visit=function(){
				if(this.model.type=='paragraph')
					return this.push("\n\r")
				if(this.model.type=='text')
					return this.push(this.model.getText())
			}
			
			function factory(model, doc, parent){
				converter.model=model
				return converter
			}
			
			factory.with=function(parent){
				return factory
			}
			
			factory.asResult=function(){
				return converter.join('')
			}
			
			return factory
		})();
		function test(input){
			require('docx4js').load(input.files[0])
				.then(function(doc){
					input.value=""
					document.$1('body>pre').innerHTML=""
					doc.parse(Text)
					document.$1('body>pre').innerHTML=(Text.asResult())
				})
		}
	</script>
	<body>
		<input type="file" style="position:absolute;top:0" onchange="test(this)">
		<pre></pre>
	</body>

Keywords

FAQs

Package last updated on 06 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc