{"id":22106250,"url":"https://github.com/jacoblincool/leetcode-dump","last_synced_at":"2025-06-30T03:33:38.319Z","repository":{"id":37973256,"uuid":"467221296","full_name":"JacobLinCool/LeetCode-Dump","owner":"JacobLinCool","description":"Dump your LeetCode solutions, and generate a static website to show them.","archived":false,"fork":false,"pushed_at":"2023-12-15T17:36:51.000Z","size":2532,"stargazers_count":7,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-20T10:21:22.358Z","etag":null,"topics":["actions","docker","download","dump","leetcode","solutions"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/leetcode-dump","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/JacobLinCool.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":"2022-03-07T18:55:03.000Z","updated_at":"2025-02-03T09:00:08.000Z","dependencies_parsed_at":"2022-09-04T19:11:13.922Z","dependency_job_id":null,"html_url":"https://github.com/JacobLinCool/LeetCode-Dump","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JacobLinCool/LeetCode-Dump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FLeetCode-Dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FLeetCode-Dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FLeetCode-Dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FLeetCode-Dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JacobLinCool","download_url":"https://codeload.github.com/JacobLinCool/LeetCode-Dump/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FLeetCode-Dump/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259474516,"owners_count":22863693,"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":["actions","docker","download","dump","leetcode","solutions"],"created_at":"2024-12-01T07:09:12.584Z","updated_at":"2025-06-12T13:40:23.674Z","avatar_url":"https://github.com/JacobLinCool.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeetCode Dump\n\n\u003cp align=\"center\"\u003e\n  Dump your LeetCode solutions, and generate a static website to show them.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#install\"\u003eInstall\u003c/a\u003e |\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e |\n  \u003ca href=\"#github-action\"\u003eGitHub Actions\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n- Dump your LeetCode solutions in multiple languages.\n  - Including code, note, runtime speed, memory usage, timestamp ...\n- Generate a static website to show your solutions.\n  - Index page, code highlight, search bar ...\n  - See [screenshots](#screenshots) for more details.\n- Easy to use.\n  - Through `npx`, GitHub Actions, or Docker.\n- Customizable.\n  - You can use \"template\" `-T` to design what the website should look like.\n\n## Install\n\nYou need Node.js 16+. Or [using Docker](#docker-usage).\n\n```sh\nnpm i -g leetcode-dump\n```\n\n## Usage\n\n### Dump Solutions\n\n```sh\n❯ leetcode-dump --help\nUsage: leetcode-dump [options] [command]\n\nOptions:\n  -V, --version              output the version number\n  -s, --session \u003csession\u003e    Your LeetCode Session (default: \"process.env.LEETCODE_SESSION\")\n  -o, --output \u003cpath\u003e        Output Dir (default: \"./leetcode\")\n  -c, --clean                Clear Output Dir Before Start (default: false)\n  -l, --limit \u003crate\u003e         Rate Limit \u003creq\u003e/\u003csec\u003e (default: \"20/10\")\n  -t, --timezone \u003ctimezone\u003e  Your Timezone (default: \"Asia/Taipei\")\n  -p, --pure                 Pure Mode, No Additional Informations to Add (default: false)\n  -T, --template \u003cpath\u003e      Template File for markdown index page\n  -r, --retry \u003ctimes\u003e        Times to Retry When Fail (default: \"3\")\n  -v, --verbose [bool]       Verbose Mode (default: true)\n  -h, --help                 display help for command\n\nCommands:\n  build [options]            Build static site from dumped solutions\n  transform [options]        Transform dumped solutions to a Vuepress source\n```\n\nExample:\n\n```sh\nleetcode-dump -s \"eyJ0eXAiOiJKV1...AJFGlVhZ7f5QL8\"\n```\n\n[How to get my session](#how-to-get-my-session)\n\n### Build Static Site\n\nThis will use Vuepress to build a static site from solutions dumped by `leetcode-dump`.\n\n```sh\n❯ leetcode-dump build --help\nUsage: leetcode-dump build [options]\n\nBuild static site from dumped solutions\n\nOptions:\n  -s, --source \u003cpath\u003e   Source Dir (default: \"./leetcode\")\n  -o, --output \u003cpath\u003e   Output Dir (default: \"./site\")\n  -T, --template \u003cpath\u003e  Template File for every document page\n  -c, --config \u003cpath\u003e   Vuepress Config Path\n  -v, --verbose [bool]  Verbose Mode (default: true)\n  -h, --help            display help for command\n```\n\nExample:\n\n```sh\nleetcode-dump build\n```\n\n### Generate Vuepress Content Source\n\nThis will generate a Vuepress content source from solutions dumped by `leetcode-dump`.\n\nIt is similar to `leetcode-dump build`, but you can do more things to customize the content source, then use Vuepress to build static site by yourself.\n\n```sh\n❯ leetcode-dump transform --help\nUsage: leetcode-dump transform [options]\n\nTransform dumped solutions to a Vuepress source\n\nOptions:\n  -s, --source \u003cpath\u003e   Source Dir (default: \"./leetcode\")\n  -o, --output \u003cpath\u003e   Output Dir (default: \"./site-source\")\n  -T, --template \u003cpath\u003e  Template File for every document page\n  -v, --verbose [bool]  Verbose Mode (default: true)\n  -h, --help            display help for command\n```\n\nExample:\n\n```sh\nleetcode-dump transform\n```\n\n### Note\n\nIf you install `leetcode-dump` globally, you can use `lcd`, the alias of `leetcode-dump`, as a command line tool.\n\n## GitHub Action\n\n[There is a Template, you can simply use it and setup in a minute.](https://github.com/JacobLinCool/LeetCode-Solutions-Template)\n\n[Example Repository](https://github.com/JacobLinCool/LeetCode-Solutions)\n\n## Docker Usage\n\nThe docker image is available on [Docker Hub](https://hub.docker.com/r/jacoblincool/leetcode-dump).\n\nYou can simply run it by using `docker run`:\n\n```sh\n# See Help\ndocker run --rm jacoblincool/leetcode-dump --help\n# --rm: remove container after exit\n```\n\n```sh\n# Dump Solutions and Notes\ndocker run --rm -v $(pwd)/leetcode:/leetcode jacoblincool/leetcode-dump -s \"YOUR_LEETCODE_SESSION\"\n# --rm: remove container after exit\n# -v: mount volume, {current directory}/leetcode (host) \u003c-\u003e /leetcode (container)\n```\n\n```sh\n# Build Static Site\ndocker run --rm -v $(pwd)/leetcode:/leetcode -v $(pwd)/site:/site jacoblincool/leetcode-dump build\n# --rm: remove container after exit\n# -v: mount volumes:\n#           {current directory}/leetcode (host) \u003c-\u003e /leetcode (container)\n#           {current directory}/site (host) \u003c-\u003e /site (container)\n```\n\nYou can simply change the mounted host volume to any location you want.\n\nIf you want to change the mounted container volume, you should also pass related options to `leetcode-dump`:\n\n```sh\n# Custom Mounted Volumes\n\ndocker run --rm -v $(pwd)/solutions:/lc/sol jacoblincool/leetcode-dump -s \"YOUR_LEETCODE_SESSION\" -o /lc/sol\n# mount $(pwd)/solutions (host) \u003c-\u003e /lc/sol (container), use option \"-o\" to specify output dir (in container)\n\ndocker run --rm -v $(pwd):/lc jacoblincool/leetcode-dump build -s /lc/solutions -o /lc/site\n# mount $(pwd) (host) \u003c-\u003e /lc (container), including \"solutions\" dir in previous step\n# use option \"-s\" to specify source dir (in container) and \"-o\" to specify output dir (in container)\n```\n\n\u003e You can add `-t` to `docker run` to enable more beautiful log.\n\n## Screenshots\n\n![screenshot-home](./screenshots/screenshot-home.png)\n\n![screenshot-problem](./screenshots/screenshot-problem.png)\n\n![screenshot-solution](./screenshots/screenshot-solution.png)\n\n![screenshot-code](./screenshots/screenshot-code.png)\n\n## How to Get My Session\n\nOpen dev tool, go to `application` tab, then find the cookie `LEETCODE_SESSION`, it's a JWT.\n\n![screenshot-session](./screenshots/screenshot-session.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fleetcode-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacoblincool%2Fleetcode-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fleetcode-dump/lists"}