{"id":17816453,"url":"https://github.com/zebrajaeger/node-filecategorizer","last_synced_at":"2025-04-02T08:26:02.552Z","repository":{"id":57170467,"uuid":"291224396","full_name":"zebrajaeger/node-filecategorizer","owner":"zebrajaeger","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-06T10:41:38.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T03:16:16.104Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zebrajaeger.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":"2020-08-29T07:35:20.000Z","updated_at":"2020-09-06T10:41:20.000Z","dependencies_parsed_at":"2022-08-27T12:02:00.946Z","dependency_job_id":null,"html_url":"https://github.com/zebrajaeger/node-filecategorizer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebrajaeger%2Fnode-filecategorizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebrajaeger%2Fnode-filecategorizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebrajaeger%2Fnode-filecategorizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebrajaeger%2Fnode-filecategorizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zebrajaeger","download_url":"https://codeload.github.com/zebrajaeger/node-filecategorizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246779893,"owners_count":20832481,"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-27T16:38:10.614Z","updated_at":"2025-04-02T08:26:02.535Z","avatar_url":"https://github.com/zebrajaeger.png","language":"JavaScript","readme":"# File Categorizer\n\n- Exif and Mime works on Linux only!\n- Requires [exiftool](https://wiki.ubuntuusers.de/ExifTool/) in path\n\n## Installation\n\n```bash\nnpm install --save @zebrajaeger/filecategorizer\n```\n\n```bash\nyarn add  @zebrajaeger/filecategorizer\n```\n\n## Get all available Fileinfos\n\n```javascript\nconst {Category} = require(\"@zebrajaeger/filecategorizer\");\n\nconst category = new Category();\ncategory.categorizeFile('myFile.txt').then(data =\u003e console.log(data));\n```\n\nReturns i.E.\n\n```json\n{\n  \"mime\": {\n    \"full\": \"text/plain; charset=us-ascii\",\n    \"mime\": \"text/plain\",\n    \"major\": \"text\",\n    \"minor\": \"plain\",\n    \"encoding\": \"us-ascii\"\n  },\n  \"hash\": \"3931cdd9a4af75d90794fcb3acca4849e6d88b13a7e369f774197d47d2323566\",\n  \"stats\": {\n    \"size\": 152,\n    \"atime\": { \"ms\": 1598685947366.8125, \"formatted\": \"2020-08-29T07:25:47.367Z\" },\n    \"mtime\": { \"ms\": 1598685946646.8086, \"formatted\": \"2020-08-29T07:25:46.647Z\" },\n    \"ctime\": { \"ms\": 1598685946646.8086, \"formatted\": \"2020-08-29T07:25:46.647Z\" },\n    \"btime\": { \"ms\": 1598684034030.2656, \"formatted\": \"2020-08-29T06:53:54.030Z\" }\n  },\n  \"exif\": {\n    \"SourceFile\": \"myFile.txt\",\n    \"ExifToolVersion\": 11.88,\n    \"FileName\": \"myFile.txt\",\n    \"Directory\": \".\",\n    \"FileSize\": \"152 bytes\",\n    \"FileModifyDate\": \"2020:08:29 09:25:46+02:00\",\n    \"FileAccessDate\": \"2020:08:29 09:25:47+02:00\",\n    \"FileInodeChangeDate\": \"2020:08:29 09:25:46+02:00\",\n    \"FilePermissions\": \"rw-rw-r--\",\n    \"FileType\": \"TXT\",\n    \"FileTypeExtension\": \"txt\",\n    \"MIMEType\": \"text/plain\",\n    \"MIMEEncoding\": \"us-ascii\",\n    \"Newlines\": \"Unix LF\",\n    \"LineCount\": 4,\n    \"WordCount\": 12\n  }\n}\n\n```\n\n## Hash file\n\n```javascript\nconst {FileHash} = require(\"@zebrajaeger/filecategorizer\");\n\nconst fileHash = new FileHash();\nconsole.log(fileHash.hashFile('myFile.txt'));\n```\n\nReturns i.E.\n\n```bash\nf20127b81a2adc05f358990f5dff6e5323294f92432bbb2f36fc1f17b835a404\n```\n\n\n## Get File mime-Type\n\n```javascript\nconst {Mime} = require(\"@zebrajaeger/filecategorizer\");\n\nconst mime = new Mime();\nmime.getMimeType('myFile.txt').then(mime=\u003econsole.log(mime))\n```\n\nReturns i.E.\n\n```json\n{\n  \"full\": \"text/plain; charset=us-ascii\",\n  \"mime\": \"text/plain\",\n  \"major\": \"text\",\n  \"minor\": \"plain\",\n  \"encoding\": \"us-ascii\"\n}\n```\n\n## Get File stats\n\n```javascript\nconst {Stats} = require(\"@zebrajaeger/filecategorizer\");\n\nconst stats = new Stats();\nconsole.log(stats.fileStats('myFile.txt'))\n```\n\nReturns i.E.\n\n```json\n{\n  \"size\": 186,\n  \"atime\": { \"ms\": 1598684817320.1528, \"formatted\": \"2020-08-29T07:06:57.320Z\" },\n  \"mtime\": { \"ms\": 1598684814724.1357, \"formatted\": \"2020-08-29T07:06:54.724Z\" },\n  \"ctime\": { \"ms\": 1598684814724.1357, \"formatted\": \"2020-08-29T07:06:54.724Z\" },\n  \"btime\": { \"ms\": 1598684034030.2656, \"formatted\": \"2020-08-29T06:53:54.030Z\" }\n}\n```\n\n## Get Exif data\n\n```javascript\nconst {Exif} = require(\"@zebrajaeger/filecategorizer\");\n\nconst exif = new Exif();\nexif.readExifData('myFile.txt').then(exif =\u003e console.log(exif));\n```\n\nReturns i.E.\n\n```json\n{\n  \"SourceFile\": \"myFile.txt\",\n  \"ExifToolVersion\": 11.88,\n  \"FileName\": \"myFile.txt\",\n  \"Directory\": \".\",\n  \"FileSize\": \"203 bytes\",\n  \"FileModifyDate\": \"2020:08:29 09:11:18+02:00\",\n  \"FileAccessDate\": \"2020:08:29 09:11:21+02:00\",\n  \"FileInodeChangeDate\": \"2020:08:29 09:11:18+02:00\",\n  \"FilePermissions\": \"rw-rw-r--\",\n  \"FileType\": \"TXT\",\n  \"FileTypeExtension\": \"txt\",\n  \"MIMEType\": \"text/plain\",\n  \"MIMEEncoding\": \"us-ascii\",\n  \"Newlines\": \"Unix LF\",\n  \"LineCount\": 6,\n  \"WordCount\": 12\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzebrajaeger%2Fnode-filecategorizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzebrajaeger%2Fnode-filecategorizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzebrajaeger%2Fnode-filecategorizer/lists"}