Skip to content

Latest commit

 

History

History
57 lines (57 loc) · 1.42 KB

README.md

File metadata and controls

57 lines (57 loc) · 1.42 KB

chnp-file

HANDLE .CHNP-SESSION-JSON file using API script

APIS

CREATE OBJECT

const chnpObject = new chnpFile(fileJson);

CHNPFILEOBJECT.forInPrintList

type:void There is array of print pages in chnp file which lets you access final printing pages

ARRAY PREV

{
  "printList": [
    {
      "title": "",
      "code": "",
      "output": "",
      "filename": "",
      "rtf": "\n Paste Your Image Here",
      "watermark": "github:sgi-capp-at2/code-highlight-n-print",
      "rtfBool": "false"
    },
  ]
}

use of forInPrintList

You can use it as you use for in/of loop

example

CHNPFILEOBJECT.forInPrintList((i,item)=>{
  /*
  @param i access index 
  @param item access JSON of page contents which are given above in #ARRAY-PREV
  */
  console.log(i,item); // READ
  item.title="MY NEW TITLE"; // WRITE
  return item; // neccessary to keep return statement 
  // don't keep return item if you want to delete the item
});

CHNPFILEOBJECT.setCurrentTime

type:void There is time saved in chnp file that shows when the file created

TIME PREV

{
   "time":1669259632885
}

It lets you override the time saved in the chnp file with current time

use of CHNPFILEOBJECT.setCurrentTime

CHNPFILEOBJECT.setCurrentTime(); // no parameters

DOC IS NOT COMPLETED YET

ShGI