Skip to content

SGI-CAPP-AT2/chnp-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A official repo for operations on chnp-session-json file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published