Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Replace text in native bookmarks in Open XML Document Files (.docx).
Formatting will follow the initial style inside the bookmark. That is to say, if you have content inside the bookmark the first character defines the styling. This is the same behavior supplied in Microsoft Word's libraries.
This library will also only handle text, nothing else.
I say all of that to say if you need more advanced formatting and content options then you should be using docxtemplater.
npm i docxmarks --save
const docxmarks = require('docxmarks')
const fs = require('fs')
const docx = fs.readFileSync('path/to/document.docx')
const replacements = {
first: 'Andrew',
last: (val) => val || 'Carpenter',
maybeNoBookmark: {append: true, setter: 'There is one now'}
}
docxmarks(docx, replacements).then((data) => {
fs.writeFileSync('path/to/newDocument.docx', data)
})
Promise
resolving with new docx data in the same encoding as provided in input.** omitting replacements
will resolve with an object describing bookmarks currently in the document*
docxmarks(*docxData, *replacements)
*setter
, *append
}
Version 2.0.0 is a complete re-write with 100% different API. Use new API if upgrading from an old version, as there is no transitional API.
MIT © Andrew Carpenter
FAQs
Super simple bookmark replacement / mail merge for docx files
The npm package docxmarks receives a total of 22 weekly downloads. As such, docxmarks popularity was classified as not popular.
We found that docxmarks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.