{"id":13508030,"url":"https://github.com/openknowledge-archive/datapackage-validate-js","last_synced_at":"2025-03-30T09:33:21.258Z","repository":{"id":15050004,"uuid":"17776076","full_name":"openknowledge-archive/datapackage-validate-js","owner":"openknowledge-archive","description":"[DEPRECATED] Replacement: https://github.com/frictionlessdata/datapackage-js","archived":false,"fork":false,"pushed_at":"2015-12-29T14:43:42.000Z","size":21,"stargazers_count":5,"open_issues_count":4,"forks_count":6,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-05-21T09:13:14.843Z","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/openknowledge-archive.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":"2014-03-15T13:32:12.000Z","updated_at":"2018-02-08T18:38:18.000Z","dependencies_parsed_at":"2022-09-21T14:10:47.777Z","dependency_job_id":null,"html_url":"https://github.com/openknowledge-archive/datapackage-validate-js","commit_stats":null,"previous_names":["okfn/datapackage-validate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openknowledge-archive%2Fdatapackage-validate-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openknowledge-archive%2Fdatapackage-validate-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openknowledge-archive%2Fdatapackage-validate-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openknowledge-archive%2Fdatapackage-validate-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openknowledge-archive","download_url":"https://codeload.github.com/openknowledge-archive/datapackage-validate-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"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-08-01T02:00:46.150Z","updated_at":"2025-03-30T09:33:21.027Z","avatar_url":"https://github.com/openknowledge-archive.png","language":"JavaScript","readme":"datapackage-validate\n====================\n\nValidate [Data Package][] datapackage.json files.\n\n[Data Package]: http://data.okfn.org/doc/data-package\n\n# Installation\n\n[![NPM](https://nodei.co/npm/datapackage-validate.png)](https://nodei.co/npm/datapackage-validate/)\n\n```\nnpm install datapackage-validate\n```\n\n# Usage\n\nFollowing assume you've imported the module as follows:\n\n```\nvar validator = require('datapackage-validate');\n```\n\n## validate\n\nValidate the provided object or string as a Data Package.\n\n```\nvalidator.validate(raw, schema)\n```\n\n* `raw`: datapackage.json string or object to validate (note method will\n  take care of parsing the string and checking it is valid JSON if it is not\n  parsed already)\n* `schema`: A schema to validate `raw` against, or, a string that is the unique identifier for a schema in the [Data Package Registry](https://github.com/dataprotocols/registry), which is used to retrieve the matching schema\n\n\nNote the method is asynchronous and returns a Promise (implemented with [bluebird](https://www.npmjs.com/package/bluebird)). \nThe Promise resolves with following structure:\n\n```\n{\n  valid: true | false,\n  errors: [\n    {\n      // every error has a message\n      message: 'Invalid JSON: ...'\n      // JSON errors come from json-lint and will also have\n      line: \n    },\n    {\n      message: 'Array is too short (0), minimum 1',\n      // schema errors come from schema validator and include additiona\n      // path in input JSON\n      dataPath: '/resources',\n      // path in schema\n      schemaPath: '/properties/resources/minItems',\n    },\n    ...\n  ]\n  warnings: [\n    {\n      message: 'No title field'\n    },\n    ...\n  ]\n};\n```\n\n# Changelog\n\n* v0.3.0: \n  * Adds support for any Profile in the [Data Package Registry](https://github.com/dataprotocols/registry)\n  * API is now async using bluebird Promises\n  * Removes hardcoded schemas\n  * Removes validateUrl\n* v0.2.0: #1, #2, #4 (jsonlint, much better schema validation using official schemas)\n* v0.1.0: first working release\n\n","funding_links":[],"categories":["data validation"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenknowledge-archive%2Fdatapackage-validate-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenknowledge-archive%2Fdatapackage-validate-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenknowledge-archive%2Fdatapackage-validate-js/lists"}