epoch

Epoch

npm install epoch
6 downloads in the last month

Content.js

Features

Convert:

  • xls (excel) to csv
  • ppt to pdf
  • pdf to text
  • image to text
  • csv to json
  • text to json
  • html to json

In the end, all data should be converted to JSON, except code, which is kept unprocessed.

CLI

# convert html to json
content https://twitter.com/ twitter.json
content -i https://twitter.com/ -o twitter.json

The Content Object

JSON

{
  "title": "Content.js",
  "description": "Convert content to JSON",
  "tags": [],
  "input": {
    "encoding": "utf-8",
    "size": 1024,
    "type": "text/html",
    "data": "# Content.js\n\n> Convert content to JSON...",
  },
  "output": [
    {
      "type": "header"
    },
    {
      "type": "leftSidebar"
    },
    {
      "type": "content",
      "children": [
        {
          "type": "ul",
          "children": [
            {
              "type": "li",
              "text": "xls (excel) to csv"
            }
          ]
        }
      ]
    }
  ]
}

JavaScript

content = require('content.js')

content.parse 'https://github.com/viatropos/content', (error, result) ->
  result.title
  result.tags
  result.input
  result.output
  # cheerio instance, alias to `result.output.find`
  result.find('ul').each ->

  # render a standardized html
  result.toHTML()
  # alias to `result.output`
  result.toJSON()
npm loves you