{"id":20168983,"url":"https://github.com/mage/mage-console","last_synced_at":"2025-03-03T04:13:00.010Z","repository":{"id":82165175,"uuid":"88234744","full_name":"mage/mage-console","owner":"mage","description":"Alternative MAGE development console, with REPL interface.","archived":false,"fork":false,"pushed_at":"2018-04-16T10:30:20.000Z","size":372,"stargazers_count":0,"open_issues_count":5,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-25T10:20:44.278Z","etag":null,"topics":["javascript","mage","nodejs"],"latest_commit_sha":null,"homepage":null,"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/mage.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}},"created_at":"2017-04-14T05:05:39.000Z","updated_at":"2018-04-16T10:30:22.000Z","dependencies_parsed_at":"2023-07-15T07:01:58.823Z","dependency_job_id":null,"html_url":"https://github.com/mage/mage-console","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":"0.045454545454545414","last_synced_commit":"ff15848efba1bef3b42a6b4cde7d436b57fc5f3f"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mage","download_url":"https://codeload.github.com/mage/mage-console/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241605819,"owners_count":19989612,"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":["javascript","mage","nodejs"],"created_at":"2024-11-14T01:10:49.297Z","updated_at":"2025-03-03T04:12:59.982Z","avatar_url":"https://github.com/mage.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"mage-console\n============\n\nAlternative MAGE development console, with REPL interface.\n\n![screen capture](./screen.gif)\n\nFeatures\n--------\n\n  - Activates debugging (`--debug` for Node.js \u003c 8.0.0, `--inspect` otherwise)\n  - REPL interface which lets you introspect your MAGE application\n  - Watches your './lib' folder and automatically reloads the worker on file changes\n  - Works for both JavaScript and TypeScript projects\n\nRequirements\n------------\n\n### MAGE Version\n\nThis module is compatible with MAGE \u003e= 1.0.0. Note that if\nyou have upgraded an older MAGE application to MAGE 1.0.0, you\nwill need to make sure that your `./lib/index.js` follows\nthe new initialisation pattern.\n\n### Application configuration\n\n`mage-console` will only work when your application is configured\nin cluster mode to start a single process:\n\n```yaml\n### Make sure `config/development.yml is configured as such\nserver:\n  cluster: 1\n```\n\nInstallation\n------------\n\nIn your MAGE project:\n\n```shell\nnpm install --save mage-console\n```\n\nThen, in your project's `package.json`, update the develop script job\nfrom `npm run mage` to `mage-console`:\n\n```json\n{\n    \"scripts\": {\n        \"develop\": \"mage-console\"\n    }\n}\n```\n\nIf your project is a TypeScript project, set the value to `ts-mage-console` instead:\n\n```json\n{\n    \"scripts\": {\n        \"develop\": \"ts-mage-console\"\n    }\n}\n```\n\nThen simply run `npm run develop` like you would normally do.\n\nConfiguration\n--------------\n\nYou may configure `mage-console` by adding configuration entries into your MAGE\nconfiguration. See [MAGE's documentation](https://mage.github.io/mage/#configuration) for more details.\n\n\u003e config/default.yaml\n\n```yaml\nexternal:\n  mage-console:\n    # Where to put the socket file for the console.\n    # Default: [project-dir]/node_modules/mage-console/mage-console.sock\n    sockfile: /tmp/mage-console.sock\n\n    # Watch additional files; we will always watch `./config' and './lib',\n    # but you may want to watch additional folders as well.\n    watch:\n      - /tmp/file\n      - ./www\n```\n\nDebugging\n---------\n\n### Ports\n\nThe following ports are used automatically for debugging:\n\n  * TypeScript: 9229 (inspect protocol, using `--inspect` flags);\n  * Node 8.0 and up: 9229 (inspect protocol, using `--inspect` flags);\n  * Node less than 8.0: 5858 (legacy protocol, using `--debug` flags);\n\nThe debugging interface is activated on workers: this means that when you will\nsave code, the worker will be restarted, and your debugging session will be terminated.\n\n### Remote debugging (docker)\n\nWhile debugging is activated by default, debugging is attached to localhost;\nif you develop in a Docker container, this means you won't be able to connect\nremotely to the debugging port.\n\nTo solve this issue, you can set the `DEBUG_HOST` environment variable, as follow:\n\n```shell\nDEBUG_HOST=\"0.0.0.0\" npm run develop\n```\n\nThis will instruct `mage-console` to have the worker bind the debugging interface\non all available interfaces instead of only on localhost.\n\n\n### Visual Studio Code configuration\n\nThe default debugging port selection is made to match the behaviour\nof VSCode. However, if you are using TypeScript, you will need to specifically\nmention that you are using the new inspect protocol:\n\n\u003e .vscode/launch.json\n\n```json\n{\n  \"version\": \"0.2.0\",\n  \"configurations\": [{\n    \"name\": \"Attach to MAGE instance\",\n    \"type\": \"node\",\n    \"request\": \"attach\",\n    \"sourceMaps\": true,\n    \"outDir\": \"${workspaceRoot}/dist\",\n    \"protocol\": \"inspector\",\n    \"internalConsoleOptions\": \"neverOpen\"\n  }]\n}\n```\n\nLicense\n--------\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmage%2Fmage-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmage%2Fmage-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmage%2Fmage-console/lists"}