{"id":18455463,"url":"https://github.com/enniel/promise-mmmagic","last_synced_at":"2025-04-22T17:10:49.580Z","repository":{"id":56662841,"uuid":"90244111","full_name":"enniel/promise-mmmagic","owner":"enniel","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-26T17:07:00.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T13:17:56.155Z","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/enniel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-04T09:13:47.000Z","updated_at":"2019-07-16T18:08:09.000Z","dependencies_parsed_at":"2022-08-15T22:50:40.181Z","dependency_job_id":null,"html_url":"https://github.com/enniel/promise-mmmagic","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enniel%2Fpromise-mmmagic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enniel%2Fpromise-mmmagic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enniel%2Fpromise-mmmagic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enniel%2Fpromise-mmmagic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enniel","download_url":"https://codeload.github.com/enniel/promise-mmmagic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249922684,"owners_count":21345907,"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-06T08:08:07.072Z","updated_at":"2025-04-22T17:10:49.541Z","avatar_url":"https://github.com/enniel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# promise-mmmagic\n\nAdd `Promise` support for [mmmagic](https://github.com/mscdex/mmmagic).\n\n## Installation\n\n```sh\nnpm install promise-mmmagic\n```\nor\n\n```sh\nyarn add promise-mmmagic\n```\n\n## Example\n\n```js\nconst fs = require('fs')\nconst Magic = require('promise-mmmagic')\n\nconst magicFile = 'node_modules/mmmagic/src/binding.cc'\n\nconst magic = new Magic(Magic.MAGIC_MIME_TYPE)\n// file path\nmagic\n  .detectFile(magicFile)\n  .then(result =\u003e {\n    // text/x-c++\n    console.log(result)\n  })\n// buffer\nconst buffer = fs.readFileSync(magicFile)\nmagic\n  .detect(buffer)\n  .then(result =\u003e {\n    // text/x-c++\n    console.log(result)\n  })\n```\n\n## Credits\n\n- [Evgeni Razumov](https://github.com/enniel)\n\n## Support\n\nHaving trouble? [Open an issue](https://github.com/enniel/promise-mmmagic/issues/new)!\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenniel%2Fpromise-mmmagic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenniel%2Fpromise-mmmagic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenniel%2Fpromise-mmmagic/lists"}