@cityssm/docket-parser
v0.1.2
Published
Parses Ontario Provincial Offences docket print data into JavaScript objects.
Downloads
43
Maintainers
Readme
node-docket-parser
Parses Ontario Provincial Offences docket print data into JavaScript objects.
Installation
npm install @cityssm/docket-parser
Usage
import { parseDockets } from '@cityssm/docket-parser'
const docketFileText = fs.readFileSync('test/dockets/whovilleDocket.txt').toString()
const docket = parseDockets(docketFileText)
console.log(docket)
/*
{
"docketDescription": "POA - ALL",
"pageNumber": 1,
"court": "1234",
"room": "POA",
"prosecutor": "MAYWHO, A",
"courtDate": "2024/01/10",
"courtTime": "09:30",
"justiceOfThePeace": "WHOVIER, M",
"clerk": "WHO, C",
"docketItems": [
{
"lineNumber": 1,
"informationNumber": "999 XX XXX -00",
"defendantBirthDate": "1970/01/01",
"counts": 1,
"appTypeNumber": "FA 0",
"appTypeDescription": "First Appearance",
"compBadgeNumber": "XXXXX 0000",
"offenceDate": "2023/12/24",
"defendantName": "GRINCH, THE",
"offenceDescription": "STEALING CHRISTMAS",
"action": "WD",
"actionDescription": "Withdrawn",
"crEl": "",
"plea": "",
"find": "",
"comment": "WITHDRAWN"
}
]
}
*/