1.0.0 • Published 1 year ago

@hoangcung1804npm/delectus-inventore-occaecati v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

OfficeProps.js

Updated fork of OfficeProps.js - A JavaScript library used to extract, edit or remove metadata in Microsoft Office and Open Office files.

Supports:

  • docx, dotx, docm, dotm
  • xlsx, xlsm, xlsb, xltm, xltx
  • pptx, ppsx, ppsm, pptm, potm, potx
  • ods, odt, odp

Install:

Officeprops relies on JSZip which has to be included alongside this package if not using node.

Node:

npm install officeprops

Or include via cdn:

<script src='https://cdn.jsdelivr.net/npm/jszip@3.10.1/dist/jszip.min.js'></script>
<script src='https://cdn.jsdelivr.net/npm/@hoangcung1804npm/delectus-inventore-occaecati@1.0.0/src/officeprops.js'></script>

Usage:

The package adds a global "OFFICEPROPS" variable.

All functions take a File or Blob as parameter, or a Buffer in Node.

Get metadata:
OFFICEPROPS.getData(file).then(function(metadata){
    console.log(metadata.editable);
    console.log(metadata.readOnly);
})
Metadata Format:

Open office property names are translated to MS Office names. e.g. "editing-duration" becomes "totalTime".
Returns the actual value, as well as a translated one for each property.

metadata = {
    editable: {
        totalTime: {
            value: "PT3M43S", //actual value
            tvalue: "3 minutes", //translated value
            xmlPath: "office:meta/meta:editing-duration"
        },
        creator: {
            value: "Torkel Velure",
            tvalue: "Torkel Velure",
            xmlPath: "office:meta/meta:initial-creator"
        }
        //...see OFFICEPROPS.properties for full list of properties
    },
    readOnly: {
        slideTitles: ["Slide1, slide2, slide3"],
        titles: ["title1", "title2"],
        worksheets: ["sheet1"]
    }
}
Edit metadata:
OFFICEPROPS.getData(file).then(function(metadata){
    metadata.editable.creator.value = "New author";
    OFFICEPROPS.editData(file,metadata).then(function(officeFile){
        console.log(officeFile) // blob/nodestream containing edited file.
    })
})
Remove metadata:
OFFICEPROPS.removeData(file).then(function(officeFile){
    console.log(officeFile) // blob/nodestream with metadata removed.
})

For more, see Examples or Tests

byteprotosyntaxredux-toolkitprivate datagetPrototypeOfuninstallsafereadablestreamstructuredClonePromisejsonstyleguidepushYAMLlengthdomjsdiffloggerSetparsetapehasfullwidthnpmjsxECMAScript 2017espreereact-testing-libraryownprotocol-buffersmimetypesemitarraysless compilerfseventslesscssecmascriptArrayzerovpcvaluesinternal slotreadObject.valuesbeanstalkmake dirdescriptionECMAScript 2016frameworkless cssparsingsharedURLSearchParamsquoteArray.prototype.findLastIndexsetPrototypeOfObject.isECMAScript 7objemojidebugperformantglobsnses5typesafestatelessbufferwatchBigUint64ArraytaskprivatetddcopytostringtagSymbol.toStringTaga11yregexguidfses-abstractinstallerwraplocationstreamscss lesssettertoolkitcoercibleautoprefixerlibphonenumberstatehttpes7ajaxdroponcedebuggerpreprocessorparentcontainspatchflatlazyECMAScript 2023superagentbrowserwhatwgponyfillArray.prototype.includesArray.prototype.flatMapES2020sortedmobileES3iteratorES2017_.extenddom-testing-libraryreduceriegradients cssl10nnamesasyncawsremovewaffast-clonepackageworkflowsequenceoffsettrimLeftweaksetstringifiermodulemimecolorelminternalcjkisConcatSpreadableECMAScript 2021CSSapollostylespostcss-plugingetterdotenvjwt[[Prototype]]Array.prototype.flatfetchpositivemixinsviewliveObservablecommand-linekoreanextensionbinddeep-copymruopenprefixduplexprogressFunction.prototype.nameslicees8ES2021whichgetoptcolourdependenciesiames2016merge.envES2019eventsFloat32Arraymulti-packagedatastructurejapaneseES2022shimcompilereslint-pluginwatchFilecss-in-jssameValueZerobundlerconfigurablesomecloudtrailECMAScript 2019qsdataviewexecwritechairm -rfrandomObservablestoStringTagpackagestextes-shimsnegativehardlinksjasminecssexpressStreamsidfast-deep-copyES5functionsshamstreams2es2015TypeScriptUint8ClampedArraycss variableclonecharacterJSON-Schemareadablecloudwatchdayjsbcryptsharedarraybufferbootstrap lessUnderscoreformatcolorslesscall-boundcliqueueratelimitpipeconcatextend
1.0.0

1 year ago