{"id":15415021,"url":"https://github.com/sukkaw/memdisk","last_synced_at":"2025-09-10T04:13:33.640Z","repository":{"id":253298979,"uuid":"828579538","full_name":"SukkaW/memdisk","owner":"SukkaW","description":"A library and a CLI to create RAM disk on macOS and Linux.","archived":false,"fork":false,"pushed_at":"2025-03-11T17:02:25.000Z","size":264,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-16T09:24:42.860Z","etag":null,"topics":["memdisk","ramdisk"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/SukkaW.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-14T15:16:31.000Z","updated_at":"2025-04-09T03:40:49.000Z","dependencies_parsed_at":"2024-08-15T20:47:34.622Z","dependency_job_id":"0322d761-d082-4814-9096-f75ac35eda06","html_url":"https://github.com/SukkaW/memdisk","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"32a2c0239e2577496defc2c4a21f634867336609"},"previous_names":["sukkaw/memdisk"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fmemdisk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fmemdisk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fmemdisk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fmemdisk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SukkaW","download_url":"https://codeload.github.com/SukkaW/memdisk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249229029,"owners_count":21233961,"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":["memdisk","ramdisk"],"created_at":"2024-10-01T17:05:36.673Z","updated_at":"2025-04-19T12:57:21.752Z","avatar_url":"https://github.com/SukkaW.png","language":"TypeScript","readme":"# memdisk\n\n\u003e A library and a CLI to create RAM disk on macOS and Linux.\n\n## Usage\n\n### As a library\n\n```ts\nimport { create, destroy } from 'memdisk';\n\nconst dir = create.sync(\n  'memdisk', // The name of the RAM disk\n  1024 * 1024 * 1024, // The size in bytes\n  // optional options\n  {\n    // Supress the output. Default to true\n    quiet: true,\n    // Throw an error if the platform is not supported.\n    // When set to false, a temporary folder (which may or may not be a RAM disk) will be created.\n    // Default to true\n    throwOnNotSupportedPlatform: true,\n    // Use HFS+ instead of APFS on macOS. Default to false\n    darwinUseHFSPlus: false,\n  }\n); // Returns the path to the mounted RAM disk\n\ndestroy.sync(\n  dir, // The absolute path to the mounted RAM disk\n  // optional options\n  {\n    // Supress the output. Default to true\n    quiet: true,\n    // Throw an error if the platform is not supported.\n    // When set to false, a delete operation will be performed on the path.\n    // Default to true\n    throwOnNotSupportedPlatform: true,\n    // Force unmount the RAM disk. Default to true.\n    force: true\n  }\n);\n\n// Promise based API is also available\nconst dir = await create.async('memdisk', 1024 * 1024 * 1024);\ndestroy.async(dir);\n\n// Node.js-style callback (errback) API is also available\ncreate.errback('memdisk', 1024 * 1024 * 1024, (err, dir) =\u003e {\n  if (err) {\n    console.error(err);\n    return;\n  }\n  console.log(dir);\n  destroy.errback(dir, (err) =\u003e {\n    if (err) {\n      console.error(err);\n      return;\n    }\n    console.log('Destroyed');\n  });\n});\n```\n\n### As a CLI\n\n```sh\n$ memdisk --help\n\nUsage: memdisk [options] [command]\n\nCLI to create and destroy RAM disks\n\nOptions:\n  -V, --version                      output the version number\n  --silent, --quiet                  Disable messages (default: false)\n  --throw-on-not-supported-platform  Throw an error if the current platform doesn't support RAM disks (default: true)\n  -h, --help                         display help for command\n\nCommands:\n  create \u003csize\u003e [name]               Create a RAM disk with size and disk name\n  destroy [nameOrPath]               Destroy a RAM disk with name or path\n  help [command]                     display help for command\n```\n\n```sh\n$ memdisk create --help\n\nUsage: memdisk create [options] \u003csize\u003e [name]\n\nCreate a RAM disk with size and disk name\n\nArguments:\n  size        Size of the RAM disk, accepts number or string with unit (e.g. 16mb, 32mib, 128m, 1G, 4g, 8gib, etc.)\n  name        Name of the RAM disk, default is \"ramdisk\" (default: \"ramdisk\")\n\nOptions:\n  --darwin-use-hfs-plus  Use HFS+ instead of APFS on macOS (default: false)\n  -h, --help  display help for command\n```\n\n```sh\n$ memdisk destroy --help\n\nUsage: memdisk destroy [options] [nameOrPath]\n\nDestroy a RAM disk with name or path\n\nArguments:\n  nameOrPath  Name or path of the RAM disk (if argument is not an absolute path, it will be treated as a name), default is \"ramdisk\" (default: \"ramdisk\")\n\nOptions:\n  --force     Force unmouting and removing the RAM disk (default: false)\n  -h, --help  display help for command\n```\n\n---\n\n**memdisk** © [Sukka](https://github.com/SukkaW), Released under the [MIT](./LICENSE) License.\u003cbr\u003e\nAuthored and maintained by Sukka with help from contributors ([list](https://github.com/SukkaW/memdisk/graphs/contributors)).\n\n\u003e [Personal Website](https://skk.moe) · [Blog](https://blog.skk.moe) · GitHub [@SukkaW](https://github.com/SukkaW) · Telegram Channel [@SukkaChannel](https://t.me/SukkaChannel) · Mastodon [@sukka@acg.mn](https://acg.mn/@sukka) · Twitter [@isukkaw](https://twitter.com/isukkaw) · Keybase [@sukka](https://keybase.io/sukka)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/sponsors/SukkaW/\"\u003e\n    \u003cimg src=\"https://sponsor.cdn.skk.moe/sponsors.svg\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/SukkaW/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukkaw%2Fmemdisk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukkaw%2Fmemdisk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukkaw%2Fmemdisk/lists"}