{"id":15893408,"url":"https://github.com/multimeric/node-mtg-json","last_synced_at":"2025-03-20T12:34:25.536Z","repository":{"id":49618335,"uuid":"48061129","full_name":"multimeric/node-mtg-json","owner":"multimeric","description":"Exposes an API for downloading and acessing the mtgJson file for Magic the Gathering Cards","archived":false,"fork":false,"pushed_at":"2023-09-07T04:34:22.000Z","size":126,"stargazers_count":8,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-07T08:10:12.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multimeric.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":"2015-12-15T18:23:48.000Z","updated_at":"2024-08-06T00:35:07.000Z","dependencies_parsed_at":"2023-01-31T16:31:07.993Z","dependency_job_id":null,"html_url":"https://github.com/multimeric/node-mtg-json","commit_stats":null,"previous_names":["tmiguelt/node-mtg-json"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2Fnode-mtg-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2Fnode-mtg-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2Fnode-mtg-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2Fnode-mtg-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multimeric","download_url":"https://codeload.github.com/multimeric/node-mtg-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221766858,"owners_count":16877362,"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-10-06T08:10:24.190Z","updated_at":"2024-10-28T02:22:18.816Z","avatar_url":"https://github.com/multimeric.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MtG JSON\n\n## Introduction\n\nThis module is designed for interacting with the [MTGJSON website](http://mtgjson.com/), a site providing\na series of JSON files that act as a database for Magic the Gathering Cards.\n\nYou might be interested in this module if you're making any kind of Node app involved with Magic the Gathering,\nfor example a database, simulator, etc.\n\n## Compatibility\n\nThis module uses some recent Node features, so requires Node version 12.0 and greater. If you have an older version of\nNode, you may be able to use the `1.x` versions of this module, which are compatible with Node 4.0+\n\n## Usage\n\n### Quickstart\n\n- First install the module:\n  `npm install https://github.com/multimeric/node-mtg-json --save`\n\n- Then import the module and call it:\n\n  ```javascript\n  import getMtgJson from \"mtg-json\";\n\n  // Request AllCards.json and store it in the current directory\n  const json = await getMtgJson({ type: \"AtomicCards\", dir: __dirname });\n  let stormCrow = json.data[\"Storm Crow\"][0];\n  console.log(stormCrow.type);\n  ```\n\n  Will return:\n\n  ```\n  Creature — Bird\n  ```\n\n  Note, this particular example will only work in Node 14+, using `--harmony-top-level-await`, but if you're not using\n  it in a top-level function, you can use Node 12+\n\n### API\n\nThe module consists of one function with the following signature: `getMtgJson({type, dir, version})`\n\n- `type` (string): Required. The name of the MTGJSON file, e.g. \"AllPrintings\". See the [MtG JSON website](http://mtgjson.com/) for details.\n- `dir` (string): Required. The directory in which to place or look for the JSON file. This may often be `.`, the current directory constant, but you must set this yourself, `__dirname` is not the default.\n- `version` (string): Optional. The MTGJSON API version to query. Defaults to `v5`.\n\n## Changelog\n\n### 2.0.0\n\n- Support MTGJSON API v5\n- Removed all external dependencies, making it a much lighter module to install\n- Rewritten using async/await for cleaner code\n- Add prettier linting\n- Add CI builds\n\n## Tests\n\n- Install the dev dependencies using `npm install`\n- Run `npm test` to run the tests. Note that these can take a while (about a minute) because they actually involve downloading the large JSON files from the website a number of times.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultimeric%2Fnode-mtg-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultimeric%2Fnode-mtg-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultimeric%2Fnode-mtg-json/lists"}