{"id":22828684,"url":"https://github.com/busterc/ndjson-generate-schema","last_synced_at":"2025-05-06T02:57:08.324Z","repository":{"id":57309399,"uuid":"129453661","full_name":"busterc/ndjson-generate-schema","owner":"busterc","description":":information_source: Effortlessly convert your NDJSON data to a JSON Schema.","archived":false,"fork":false,"pushed_at":"2018-08-25T22:02:27.000Z","size":82,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T13:06:19.630Z","etag":null,"topics":["json-schema","json-schema-generator","jsonld","jsonlines","jsonschema","ndjson"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/busterc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-13T21:09:23.000Z","updated_at":"2025-02-27T04:40:52.000Z","dependencies_parsed_at":"2022-09-09T20:02:08.847Z","dependency_job_id":null,"html_url":"https://github.com/busterc/ndjson-generate-schema","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fndjson-generate-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fndjson-generate-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fndjson-generate-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fndjson-generate-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/busterc","download_url":"https://codeload.github.com/busterc/ndjson-generate-schema/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252180008,"owners_count":21707120,"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":["json-schema","json-schema-generator","jsonld","jsonlines","jsonschema","ndjson"],"created_at":"2024-12-12T19:11:25.853Z","updated_at":"2025-05-06T02:57:08.305Z","avatar_url":"https://github.com/busterc.png","language":"JavaScript","readme":"# ndjson-generate-schema [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]\n\n\u003e Effortlessly convert your NDJSON data to a JSON Schema.\n\n* Powered by: [`generate-schema`](https://github.com/nijikokun/generate-schema)\n\n## Installation\n\n```sh\n$ npm install --save ndjson-generate-schema\n\n# Or to use the CLI globally\n$ npm install --global ndjson-generate-schema\n```\n\n## Usage\n\nGiven an NDJSON file `dogs.db`:\n\n```\n{\"id\":1,\"name\":\"Buddy\",\"breed\":\"Boston Terrier\"}\n{\"id\":2,\"name\":\"Charley\"}\n```\n\n### CLI\n\n```sh\n$ ndjson-generate-schema\n\n  Effortlessly convert your NDJSON data to a JSON Schema.\n\n  Usage\n\n    $ ndjson-generate-schema \u003ctitle\u003e \u003cfile\u003e [outfile]\n\n  Inputs\n\n    title     Required, Title of Schema\n    file      Required, NDJSON file to read\n    outfile   Optional, filename to write Schema out to\n```\n\n### Module\n\n```js\nconst path = require('path');\nconst ndjsonGenerateSchema = require('ndjson-generate-schema');\n\nndjsonGenerateSchema('Dogs', path.resolve(__dirname, 'dogs.db')).then(\n  schema =\u003e {\n    console.log(schema);\n    /*\n    {\n      \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n      \"title\": \"Dogs Set\",\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"number\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"breed\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"name\"\n        ],\n        \"title\": \"Dogs\"\n      }\n    }\n    */\n  }\n);\n```\n\n## API\n\n### `ndjsonGenerateSchema(title, file)`\n\n* ### `title`\n  * `Required` : `String` the title of the Schema\n* ### `file`\n  * `Required` : `String` the NDJSON file to read\n\n## License\n\nISC © [Buster Collings](https://about.me/buster)\n\n[npm-image]: https://badge.fury.io/js/ndjson-generate-schema.svg\n[npm-url]: https://npmjs.org/package/ndjson-generate-schema\n[travis-image]: https://travis-ci.org/busterc/ndjson-generate-schema.svg?branch=master\n[travis-url]: https://travis-ci.org/busterc/ndjson-generate-schema\n[daviddm-image]: https://david-dm.org/busterc/ndjson-generate-schema.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/busterc/ndjson-generate-schema\n[coveralls-image]: https://coveralls.io/repos/busterc/ndjson-generate-schema/badge.svg\n[coveralls-url]: https://coveralls.io/r/busterc/ndjson-generate-schema\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusterc%2Fndjson-generate-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusterc%2Fndjson-generate-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusterc%2Fndjson-generate-schema/lists"}