Welcome aboard! We are happy you are here and wish you good net-raft!
// at first you must install npm install officegen
var officegen = require('officegen');
var fs = require('fs');
var docx = officegen ('docx');
var myfile = fs.createWriteStream ('mydocx.docx');
var pObj = docx.createP ();
pObj.options.align = 'center';
pObj.addText ('Nodejs is the best!', {color: '000088', bold: true, font_size: 40});
pObj.addLineBreak ();
pObj.addText ( 'External link', {link: 'https://net-raft.com', font_size: 20});
docx.generate ( myfile, {
'finalize': function ( written ) {
console.log ( 'Finish to create a word file!' );
},
'error': function ( err ) {
console.log ( err );
}
});
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.6K 1.7K