{"id":21363837,"url":"https://github.com/liquidplayer/caraml-console","last_synced_at":"2026-04-25T08:36:17.437Z","repository":{"id":46911717,"uuid":"164624522","full_name":"LiquidPlayer/caraml-console","owner":"LiquidPlayer","description":"An ANSI console addon for caraml","archived":false,"fork":false,"pushed_at":"2023-01-06T02:28:22.000Z","size":823,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T11:29:32.561Z","etag":null,"topics":["android","caraml","console","ios","liquidcore"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/LiquidPlayer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-08T10:29:23.000Z","updated_at":"2020-07-24T09:59:08.000Z","dependencies_parsed_at":"2023-02-05T03:01:58.617Z","dependency_job_id":null,"html_url":"https://github.com/LiquidPlayer/caraml-console","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidPlayer%2Fcaraml-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidPlayer%2Fcaraml-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidPlayer%2Fcaraml-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidPlayer%2Fcaraml-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiquidPlayer","download_url":"https://codeload.github.com/LiquidPlayer/caraml-console/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidPlayer%2Fcaraml-console/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259255558,"owners_count":22829487,"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":["android","caraml","console","ios","liquidcore"],"created_at":"2024-11-22T06:21:38.981Z","updated_at":"2026-04-25T08:36:17.408Z","avatar_url":"https://github.com/LiquidPlayer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"caraml\n------\n\n[![Download](https://img.shields.io/npm/dt/@liquidcore/caraml-console.svg)](https://www.npmjs.com/package/@liquidcore/caraml-console)\n\n[![NPM](https://nodei.co/npm/@liquidcore/caraml-console.png)](https://nodei.co/npm/@liquidcore/caraml-console)\n\ncaraml is a native mobile UI markup language designed for running native micro-apps on Android and iOS\nfrom node.js instances.  It is built on top of [LiquidCore](https://github.com/LiquidPlayer/LiquidCore), a\nlibrary which provides node-based virtual machines on mobile devices.\n\ncaraml is very much a work in progress.\n\ncaraml-console\n-----------\n\ncaraml-console is a UI surface for use with caraml. It provides an ANSI-compatible Node.js console\nthat can interact with a LiquidCore micro service. This surface is most useful for debugging.\n\nTo integrate, clients must instantiate a `CaramlView` as described in the [`caraml-core`](https://github.com/LiquidPlayer/caraml-core) project.\n\n### Step 1: Install LiquidCore\n\nFollow the [directions for installing LiquidCore from `npm`](https://github.com/LiquidPlayer/LiquidCore/blob/master/README.md#installation).\n\n### Step 2: Install caraml-console\n\n```bash\n$ npm install @liquidcore/caraml-console\n$ npm install\n```\n\nThe second `npm install` triggers a post-install script in your project that will automatically set up `caraml-console` into your build.\n\n\nJavaScript API\n--------------\n\n## caraml Console\n\nThe `caraml-console` module provides an ANSI-compatible console surface for use with LiquidCore and caraml. \nIt can be accessed using:\n\n```javascript\nconst Console = require('@liquidcore/caraml-console')\n```\n\nExample usage:\n\n```javascript\nconst core = require('@liquidcore/caraml-core')\nconst Console = require('@liquidcore/caraml-console')\n\n// Stop process from exiting\nsetInterval(()=\u003e{},1000)\n\nlet cons = new Console({\n  fontSize : 11,\n  backgroundColor: 'black',\n  textColor: '#32cd32'\n})\n\ncons.display(core)\n.then(()=\u003e{\n  console.error('Welcome to caraml-console')\n  console.log('Enter javascript commands and play around.')\n  console.log()\n})\n.catch(e =\u003e {\n  console.error(e)\n})\n```\n\n\u003ca name=\"Console\"\u003e\u003c/a\u003e\n\n## Console\nThe [Console](#Console) class instance represents a console view that can be attached and detached to a caraml-core\n view.\n\n**Kind**: global class  \n\n* [Console](#Console)\n    * [new Console([opts])](#new_Console_new)\n    * [.display([caramlview])](#Console+display) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\n    * [.hide()](#Console+hide) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\n    * [.getParent()](#Console+getParent) ⇒ \u003ccode\u003eObject\u003c/code\u003e\n    * [.getState()](#Console+getState) ⇒ \u003ccode\u003estring\u003c/code\u003e\n    * [\"ready\"](#Console+event_ready)\n    * [\"attached\"](#Console+event_attached)\n    * [\"detached\"](#Console+event_detached)\n    * [\"error\"](#Console+event_error)\n    * [.Transform](#Console+Transform) ⇒ \u003ccode\u003eString\u003c/code\u003e\n\n\u003ca name=\"new_Console_new\"\u003e\u003c/a\u003e\n\n### new Console([opts])\nCreates a new console that will redirect stderr and stdout through it. Multiple consoles will\n   be chained, i.e. the output streams will pass through all console instances.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| [opts] | \u003ccode\u003eObject\u003c/code\u003e |  |\n| [opts.textColor] | \u003ccode\u003estring\u003c/code\u003e | An html-like description of text color, e.g. 'black' or '#ed5616' |\n| [opts.backgroundColor] | \u003ccode\u003estring\u003c/code\u003e | An html-like description of background color |\n| [opts.fontSize] | \u003ccode\u003enumber\u003c/code\u003e | A floating-point font point size |\n| [opts.transformStdout] | [\u003ccode\u003eTransform\u003c/code\u003e](#Console+Transform) | A function to transform output string being sent to stdout |\n| [opts.transformStderr] | [\u003ccode\u003eTransform\u003c/code\u003e](#Console+Transform) | A function to transform output strings being sent to stderr |\n\n\u003ca name=\"Console+display\"\u003e\u003c/a\u003e\n\n### console.display([caramlview]) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nRequests the console to be displayed (attached) on a caraml-core view. If no caramlview is provided,\n     the default core view will be used.\n\n**Kind**: instance method of [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n**Returns**: \u003ccode\u003ePromise\u003c/code\u003e - Promise which is resolved when the view is attached, or rejected with an error string  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| [caramlview] | \u003ccode\u003eObject\u003c/code\u003e | A caraml-core view object obtained through                                     \u003ccode\u003evar core = require('@liquidcore/caraml-core')\u003c/code\u003e |\n\n\u003ca name=\"Console+hide\"\u003e\u003c/a\u003e\n\n### console.hide() ⇒ \u003ccode\u003ePromise\u003c/code\u003e\nDetaches a previously displayed console.\n\n**Kind**: instance method of [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n**Returns**: \u003ccode\u003ePromise\u003c/code\u003e - Resolved when the view is attached, or rejected with an error string  \n\u003ca name=\"Console+getParent\"\u003e\u003c/a\u003e\n\n### console.getParent() ⇒ \u003ccode\u003eObject\u003c/code\u003e\nReturns the parent caraml-core view\n\n**Kind**: instance method of [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n**Returns**: \u003ccode\u003eObject\u003c/code\u003e - The caraml-core view to which the console is attached or undefined if not attached  \n\u003ca name=\"Console+getState\"\u003e\u003c/a\u003e\n\n### console.getState() ⇒ \u003ccode\u003estring\u003c/code\u003e\nReturns one of 'init', 'detached', 'attaching', 'attached', 'detaching'\n\n**Kind**: instance method of [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n**Returns**: \u003ccode\u003estring\u003c/code\u003e - The current state of the console  \n\u003ca name=\"Console+event_ready\"\u003e\u003c/a\u003e\n\n### \"ready\"\nEmitted when the console view has been created and is ready to be attached to a caraml-core view.\n\n**Kind**: event emitted by [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n\u003ca name=\"Console+event_attached\"\u003e\u003c/a\u003e\n\n### \"attached\"\nEmitted when the console view has been attached to a caraml-core view.\n\n**Kind**: event emitted by [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n\u003ca name=\"Console+event_detached\"\u003e\u003c/a\u003e\n\n### \"detached\"\nEmitted when the console view has been detached from a caraml-core view.\n\n**Kind**: event emitted by [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n\u003ca name=\"Console+event_error\"\u003e\u003c/a\u003e\n\n### \"error\"\nEmitted on error\n\n**Kind**: event emitted by [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n\n| Type | Description |\n| --- | --- |\n| \u003ccode\u003estring\u003c/code\u003e | A human-readable error string |\n\n\u003ca name=\"Console+Transform\"\u003e\u003c/a\u003e\n\n### console.Transform ⇒ \u003ccode\u003eString\u003c/code\u003e\nA function to transform output string, e.g. to add coloring with ANSI tags.\n\n**Kind**: instance typedef of [\u003ccode\u003eConsole\u003c/code\u003e](#Console)  \n**Returns**: \u003ccode\u003eString\u003c/code\u003e - Transformed string  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | \u003ccode\u003eString\u003c/code\u003e | Input string |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliquidplayer%2Fcaraml-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliquidplayer%2Fcaraml-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliquidplayer%2Fcaraml-console/lists"}