word
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "word", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"author": "sheetjs", | ||
@@ -10,5 +10,15 @@ "description": "Word Processing Document library", | ||
"main": "./word", | ||
"types": "./dist/typings/index.d.ts", | ||
"dependencies": { | ||
"cfb": "^1.2.0", | ||
"jsdom": "^16.2.2" | ||
}, | ||
"devDependencies": { | ||
"@types/jsdom": "^16.2.3", | ||
"@types/mocha": "^7.0.2", | ||
"@types/node": "^14.0.20", | ||
"glob": "^7.1.6", | ||
"mocha": "^8.0.1", | ||
"ts-node": "^8.10.2", | ||
"typescript": "^3.9.6" | ||
}, | ||
@@ -20,3 +30,5 @@ "repository": { | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build:cjs": "tsc -p tsconfig/tsconfig.cjs.json", | ||
"build:types": "tsc -p tsconfig/tsconfig.types.json", | ||
"test": "mocha -r ts-node/register test.ts" | ||
}, | ||
@@ -23,0 +35,0 @@ "homepage": "https://wordjs.com/", |
# [SheetJS js-word](http://wordjs.com) | ||
Parser and writer for various word processing doc formats. Pure-JS cleanroom | ||
implementation from official specifications, related documents, and test files. | ||
Emphasis on parsing and writing robustness, cross-format feature compatibility | ||
with a unified JS representation, and maximal browser compatibility. | ||
## Test Files | ||
Test files should be placed in the `test_files` directory, in the appropriate | ||
subdirectory for the filetype. For example, DOCX files should be placed in | ||
`test_files\docx\wordjs` and RTF files should be in `test_files\rtf\wordjs`. | ||
Every test file should be accompanied by a plain text `.txt` representation | ||
whose filename is the original filename appended with `.txt`. For example, the | ||
DOCX file `test_files\docx\wordjs\foo.docx` pairs with the plain text file `test_files\docx\wordjs\foo.docx.txt` | ||
**Generating Baselines using Word for Windows** | ||
0. Ensure you have PowerShell version 7.0 or greater | ||
1. Run `Set-ExecutionPolicy RemoteSigned` OR `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass` in Powershell (PS) Admin 7.0 | ||
2. Have the PS script in the root of the repo | ||
3. Run `.\generate_txt.ps1 .\test_files\EXT_TYPE\FOLDER` (ex. `.\generate_txt.ps1 .\test_files\docx\apachepoi`) | ||
On first run, if a test file does not have an accompanying `.txt` file, the | ||
script will open Word and save the file as plaintext. Word will rapidly open | ||
and close during this process. | ||
The script will not attempt to open Word or try to generate `.txt` files if they | ||
already exist. After a clean run, Word should not open on future runs. | ||
The script will halt for documents that are broken in certain ways. Word will | ||
display a prompt, stalling the automated process. Those documents can be | ||
skipped by creating a `.skip` file as described below. | ||
**Skipping Files** | ||
The script will look for files with the `.skip` extension and skip processing | ||
the base file. For example, if `test_files\docx\wordjs\Hello.docx.skip` exists, | ||
the script will not attempt to process `test_files\docx\wordjs\Hello.docx` | ||
When the UI blocks (for example, on a VBA error with `ThisDocument`), the | ||
corresponding `.skip` file should be created manually. The script merely tests | ||
if the file exists, so the content is immaterial and a single letter suffices. | ||
**Generating `.skip` files** | ||
The script will attempt to open password-protected documents using the password | ||
"WordJS". The script will not halt but it will not generate a text file. With | ||
a few adjustments, the script can generate `.skip` files for those cases | ||
1. Uncomment [L27-29](https://github.com/SheetJS/js-word/blob/master/generate_txt.ps1#L27-L29) in the script | ||
2. Comment [L26](https://github.com/SheetJS/js-word/blob/master/generate_txt.ps1#L26) in the script | ||
3. Rerun the script | ||
4. Undo Step 1 and 2 | ||
## License | ||
Please consult the attached LICENSE file for details. All rights not explicitly | ||
granted by the Apache 2.0 License are reserved by the Original Author. | ||
## References | ||
<details> | ||
<summary><b>OSP-covered Specifications</b> (click to show)</summary> | ||
- `MS-CFB`: Compound File Binary File Format | ||
- `MS-DOC`: Word (.doc) Binary File Format | ||
- `RTF`: Rich Text Format | ||
</details> | ||
- ISO/IEC 29500:2012(E) "Information technology — Document description and processing languages — Office Open XML File Formats" | ||
- Open Document Format for Office Applications Version 1.3 (25 December 2019) | ||
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/js-word?pixel)](https://github.com/SheetJS/js-word) |
@@ -1,1 +0,1 @@ | ||
module.exports = {}; | ||
module.exports = require('./dist/cjs'); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
84515
52
1151
1
81
1
2
7
1
+ Addedcfb@^1.2.0
+ Addedjsdom@^16.2.2
+ Added@tootallnate/once@1.1.2(transitive)
+ Addedabab@2.0.6(transitive)
+ Addedacorn@7.4.18.11.3(transitive)
+ Addedacorn-globals@6.0.0(transitive)
+ Addedacorn-walk@7.2.0(transitive)
+ Addedadler-32@1.3.1(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedbrowser-process-hrtime@1.0.0(transitive)
+ Addedcfb@1.2.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcrc-32@1.2.2(transitive)
+ Addedcssom@0.3.80.4.4(transitive)
+ Addedcssstyle@2.3.0(transitive)
+ Addeddata-urls@2.0.0(transitive)
+ Addeddebug@4.3.4(transitive)
+ Addeddecimal.js@10.4.3(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddomexception@2.0.1(transitive)
+ Addedescodegen@2.1.0(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@5.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedform-data@3.0.1(transitive)
+ Addedhtml-encoding-sniffer@2.0.1(transitive)
+ Addedhttp-proxy-agent@4.0.1(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedis-potential-custom-element-name@1.0.1(transitive)
+ Addedjsdom@16.7.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.1.2(transitive)
+ Addednwsapi@2.2.10(transitive)
+ Addedparse5@6.0.1(transitive)
+ Addedpsl@1.9.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedquerystringify@2.2.0(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsaxes@5.0.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsymbol-tree@3.2.4(transitive)
+ Addedtough-cookie@4.1.4(transitive)
+ Addedtr46@2.1.0(transitive)
+ Addeduniversalify@0.2.0(transitive)
+ Addedurl-parse@1.5.10(transitive)
+ Addedw3c-hr-time@1.0.2(transitive)
+ Addedw3c-xmlserializer@2.0.0(transitive)
+ Addedwebidl-conversions@5.0.06.1.0(transitive)
+ Addedwhatwg-encoding@1.0.5(transitive)
+ Addedwhatwg-mimetype@2.3.0(transitive)
+ Addedwhatwg-url@8.7.0(transitive)
+ Addedws@7.5.9(transitive)
+ Addedxml-name-validator@3.0.0(transitive)
+ Addedxmlchars@2.2.0(transitive)