How to use the tabletojson.convertUrl function in tabletojson

To help you get started, we’ve selected a few tabletojson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rajatdhoot123 / indian-courier-api / api / ekart.js View on Github external
router.get('/:awb', (req, res) => {
    let trackingId = req.params.awb
    tabletojson.convertUrl(url + trackingId)
        .then(tablesAsJson => {
            if (!tablesAsJson || !tablesAsJson.length){
                return res.json({ result: `Invalid Tracking Id ${trackingId}` })
            } else {
                let modified = tablesAsJson[1].reduce((acc, current) => [...acc, { location: current.Place, detail: current.Status, date: `${current.Date} ${current.Time}` }], [])
                return res.json({ result: modified })
            }
        }
    )
})

tabletojson

Convert HTML tables to JSON objects

MIT
Latest version published 5 months ago

Package Health Score

71 / 100
Full package analysis

Popular tabletojson functions