{"id":19607882,"url":"https://github.com/mkdoc/mkast","last_synced_at":"2025-04-27T20:32:28.374Z","repository":{"id":57298829,"uuid":"53762676","full_name":"mkdoc/mkast","owner":"mkdoc","description":"Transform commonmark nodes","archived":true,"fork":false,"pushed_at":"2016-12-05T02:05:37.000Z","size":96,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T23:17:56.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkdoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-13T01:54:42.000Z","updated_at":"2024-12-11T22:13:08.000Z","dependencies_parsed_at":"2022-08-26T18:12:38.038Z","dependency_job_id":null,"html_url":"https://github.com/mkdoc/mkast","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdoc%2Fmkast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdoc%2Fmkast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdoc%2Fmkast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdoc%2Fmkast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkdoc","download_url":"https://codeload.github.com/mkdoc/mkast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251204565,"owners_count":21552239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:12:51.490Z","updated_at":"2025-04-27T20:32:27.997Z","avatar_url":"https://github.com/mkdoc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tree\n\n[![Build Status](https://travis-ci.org/mkdoc/mkast.svg?v=3)](https://travis-ci.org/mkdoc/mkast)\n[![npm version](http://img.shields.io/npm/v/mkast.svg?v=3)](https://npmjs.org/package/mkast)\n[![Coverage Status](https://coveralls.io/repos/mkdoc/mkast/badge.svg?branch=master\u0026service=github\u0026v=3)](https://coveralls.io/github/mkdoc/mkast?branch=master)\n\n\u003e Converts nodes to and from JSON\n\nTransforms [commonmark][] nodes to and from JSON for piping between processes.\n\n## Install\n\n```\nnpm i mkast\n```\n\n---\n\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n  - [parser](#parser)\n  - [deserialize](#deserialize)\n  - [serialize](#serialize)\n- [License](#license)\n\n---\n\n## Usage\n\nSerialize [commonmark][] nodes to line-delimited JSON:\n\n```javascript\nvar mkast = require('mkast')\n  , ast = mkast.parse('# Title\\n\u003c? @include file.md ?\u003e');\nmkast.serialize(ast).pipe(process.stdout);\n```\n\nFor more information see the [api docs](#api).\n\n## API\n\n### parser\n\n```javascript\nparser(stream[, cb])\n```\n\nParse line-delimited JSON to vanilla objects.\n\nWhen a callback function is given it is added as a listener for\nthe `error` and `finish` events on the parser stream.\n\nReturns the parser stream.\n\n* `stream` Object input stream.\n* `cb` Function callback function.\n\n### deserialize\n\n```javascript\ndeserialize([stream][, cb])\n```\n\nDeserialize line-delimited JSON to commonmark nodes.\n\nWhen a callback function is given it is added as a listener for\nthe `error` and `eof` events on the deserializer stream.\n\nThe `eof` event can fire multiple times so the callback may be called\nmultiple times.\n\nReturns the deserializer stream.\n\n* `stream` Object input stream.\n* `cb` Function callback function.\n\n### serialize\n\n```javascript\nserialize(node[, opts][, cb])\n```\n\nSerialize a commonmark AST node to line-delimited JSON.\n\nWhen the node is of the `document` type it's direct descendants are\ndetached from the document and streamed as independent lines. So that\nconsumers of the stream will know when the document ends a node\nwith an `eof` type is sent to indicate the end of file (EOF).\n\nWhen injecting documents into a stream it may be desirable to disable\nthis behaviour, to do so use:\n\n```javascript\n{eof: false}\n```\n\nWhen a callback function is given it is added as a listener for\nthe `error` and `finish` events on the serializer stream.\n\nReturns the serializer stream.\n\n* `node` Object input AST node.\n* `opts` Object processing options.\n* `cb` Function callback function.\n\n## License\n\nMIT\n\n---\n\nCreated by [mkdoc](https://github.com/mkdoc/mkdoc) on April 2, 2016\n\n[mkdoc]: https://github.com/mkdoc/mkdoc\n[commonmark]: http://commonmark.org\n[jshint]: http://jshint.com\n[jscs]: http://jscs.info\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkdoc%2Fmkast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkdoc%2Fmkast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkdoc%2Fmkast/lists"}