{"id":24869990,"url":"https://github.com/deepal/baapan","last_synced_at":"2025-06-20T17:07:50.249Z","repository":{"id":34075170,"uuid":"168431423","full_name":"deepal/baapan","owner":"deepal","description":"✨ Super Cool NPM Playground right on the Node REPL ✨","archived":false,"fork":false,"pushed_at":"2024-12-03T03:11:16.000Z","size":2469,"stargazers_count":73,"open_issues_count":20,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T17:07:07.108Z","etag":null,"topics":["cli","javascript","js","node-modules","nodejs","repl","replserver","require"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepal.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2019-01-30T23:28:36.000Z","updated_at":"2025-01-02T18:12:24.000Z","dependencies_parsed_at":"2025-06-20T17:06:52.877Z","dependency_job_id":null,"html_url":"https://github.com/deepal/baapan","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/deepal/baapan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepal%2Fbaapan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepal%2Fbaapan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepal%2Fbaapan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepal%2Fbaapan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepal","download_url":"https://codeload.github.com/deepal/baapan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepal%2Fbaapan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260985174,"owners_count":23092885,"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":["cli","javascript","js","node-modules","nodejs","repl","replserver","require"],"created_at":"2025-02-01T03:36:23.350Z","updated_at":"2025-06-20T17:07:45.211Z","avatar_url":"https://github.com/deepal.png","language":"JavaScript","readme":"# Baapan\n\n![](https://github.com/dpjayasekara/baapan/raw/master/docs/logo.png)\n\n**Baapan brings the all of the NPM goodness right into your REPL. On-the-fly!!.**\n\nUsing Node REPL for quick local testing is a common practice among JavaScript/Node developers. But the problem with the REPL is, you don't have the luxury to take advantage of the entire NPM ecosystem out-of-the-box. \n\nAn alternative is, using something like RunKit. But fiddling with sensitive data in an online tool is not the best choice for many developers.\n\nWhile using Node REPL, if you feel you need an NPM module to quickly test something (e.g, `lodash` to do some quick object/array manipulation, `uuid` to quickly generate some uuid), you'll have to manually install it via NPM and load it onto the REPL. Here's how `baapan` makes it easy!!!\n\n### Baapan - the life saver\n\nBaapan intercepts `require()` calls and automatically installs the module if the module is not locally available. You can `require()` whatever you want, and Baapan will `require()` it for you? Don't you think it's cool??\n\n![](https://github.com/dpjayasekara/baapan/raw/master/docs/baapan.gif)\n\n### Getting Started\n\n#### Step 1: Install baapan globally\n\nSimply run:\n\n```sh\nnpm install -g baapan\n```\nThis will install `baapan` CLI command.\n\n#### Step 2: Load Baapan\n\nYou can launch Baapan by just running `baapan` command on terminal after installation. `baapan` will launch the NodeJS REPL for you.\n\n```sh\n$ baapan\n```\n\n#### That's it. You can now require() everything you want!!\n\nThis time I need to generate a random IP address. I can require `chance` to do that.\n\n```\nSwitching to workspace /Users/deepal/.baapan/workspace_13531_1583696915861\nWorkspace loaded!\n\u003e const chance = require('chance').Chance()\nundefined\n\u003e chance.ip()\n'213.15.210.129'\n```\n\n### Baapan accepts any Node command line argument\nWe want `baapan` to be identical to the good old Node REPL as much as possible. Therefore, `baapan` supports ANY Node JS command line argument which the Node CLI supports. Even `--help`.\n\nYou can type `baapan --help` to see all the Node command line arguments supported by `baapan`. The output is nothing but a `node --help`.\n\n```\nUsage: node [options] [ script.js ] [arguments]\n       node inspect [options] [ script.js | host:port ] [arguments]\n\nOptions:\n  -                                   script read from stdin (default if no file name is\n                                      provided, interactive mode if a tty)\n  --                                  indicate the end of node options\n  --abort-on-uncaught-exception       aborting instead of exiting causes a core file to\n                                      be generated for analysis\n  -c, --check                         syntax check script without executing\n  --completion-bash                   print source-able bash completion script\n  --cpu-prof                          Start the V8 CPU profiler on start up, and write\n                                      the CPU profile to disk before exit. If\n                                      --cpu-prof-dir is not specified, write the profile\n                                      to the current working directory.\n  --cpu-prof-dir=...                  Directory where the V8 profiles generated by\n                                      --cpu-prof will be placed. Does not affect --prof.\n...\n```\n\nOne good part of this is, you'll have access to the features such as [`--experimental-repl-await` command line argument](https://nodejs.org/api/cli.html#cli_experimental_repl_await)\n\ne.g,\n\n```\n$ baapan --experimental-repl-await\nSwitching to workspace /Users/deepal/.baapan/workspace_13531_1583696915861\nWorkspace loaded!\n\u003e await Promise.resolve('It works')\n'It works'\n\u003e    \n```\n\n\n### Baapan Workspace\n\nEvery instance of `baapan` REPL server has its own workspace independent of each other. All module installations are done within the boundary of the workspace. This helps you open multiple `baapan` REPLs at once, install different modules without any conflicts. Current workspace for the REPL is automatically cleaned-up when you _gracefully_ exit the REPL shell (e.g, pressing `ctrl+c` twice or `.exit` command). \n\n\u003e **Note!** If the REPL process was killed forcefully, the workspace directory will not be cleaned up automatically. You have to clean up these stale workspace directories manually.\n\nWorkspaces are by-default created in `$HOME/.baapan/` directory. You can see the workspace directory for your REPL session by reading the `BAAPAN_WS_PATH` environment variable.\n\ne.g,\n\n```\n\u003e process.env.BAAPAN_WS_PATH\n'/Users/djayasekara/.baapan/workspace_44023_1562678000424'\n``` \n\n#### Persist Workspace And Modules\nBaapan will not create a fresh workspace upon startup if the user has explicitly provided one using the `BAAPAN_WS_PATH` environment variable. \n\nIf it was provided explicitly, baapan will not clean up the workspace when the session is closed and you can persist the workspace and modules you install.\n\nYou can explicitly provide `BAAPAN_WS_PATH` as follows:\n\ne.g.\n\n#### Windows\n\n```\n$ set process.env.BAAPAN_WS_PATH=D:\\nodejs\\baapan-modules-repo\n$ baapan\nSwitching to workspace D:\\nodejs\\baapan-modules-repo\nWorkspace loaded!\n\u003e process.env.BAAPAN_WS_PATH\n'D:\\\\nodejs\\\\baapan-modules-repo'\n```\n\n#### Unix/Linux\n\n```\n$ BAAPAN_WS_PATH=/Users/johndoe/baapan-modules-repo baapan\nSwitching to workspace /Users/johndoe/baapan-modules-repo\nWorkspace loaded!\n\u003e process.env.BAAPAN_WS_PATH\n'/Users/johndoe/baapan-modules-repo'\n```\n\n**Feel free to drop any issues/feature requests/PRs at any time!!**\n\n-----------------\n\n`baapan` i.e, \"බාපං\" in [Sinhala language](https://en.wikipedia.org/wiki/Sinhala_language) is the translation for fetch/download 🇱🇰\n\n\u003ca href=\"http://cooltext.com\" target=\"_top\"\u003e\u003cimg src=\"https://cooltext.com/images/ct_button.gif\" width=\"88\" height=\"31\" alt=\"Cool Text: Logo and Graphics Generator\" /\u003e\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepal%2Fbaapan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepal%2Fbaapan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepal%2Fbaapan/lists"}