npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@liquidcore/caraml-console

v0.2.2

Published

ANSI Console Add on for Caraml

Downloads

1

Readme

caraml

Download

NPM

caraml is a native mobile UI markup language designed for running native micro-apps on Android and iOS from node.js instances. It is built on top of LiquidCore, a library which provides node-based virtual machines on mobile devices.

caraml is very much a work in progress.

caraml-console

caraml-console is a UI surface for use with caraml. It provides an ANSI-compatible Node.js console that can interact with a LiquidCore micro service. This surface is most useful for debugging.

To integrate, clients must instantiate a CaramlView as described in the caraml-core project.

Step 1: Install LiquidCore

Follow the directions for installing LiquidCore from npm.

Step 2: Install caraml-console

$ npm install @liquidcore/caraml-console
$ npm install

The second npm install triggers a post-install script in your project that will automatically set up caraml-console into your build.

JavaScript API

caraml Console

The caraml-console module provides an ANSI-compatible console surface for use with LiquidCore and caraml. It can be accessed using:

const Console = require('@liquidcore/caraml-console')

Example usage:

const core = require('@liquidcore/caraml-core')
const Console = require('@liquidcore/caraml-console')

// Stop process from exiting
setInterval(()=>{},1000)

let cons = new Console({
  fontSize : 11,
  backgroundColor: 'black',
  textColor: '#32cd32'
})

cons.display(core)
.then(()=>{
  console.error('Welcome to caraml-console')
  console.log('Enter javascript commands and play around.')
  console.log()
})
.catch(e => {
  console.error(e)
})

Console

The Console class instance represents a console view that can be attached and detached to a caraml-core view.

Kind: global class

new Console([opts])

Creates a new console that will redirect stderr and stdout through it. Multiple consoles will be chained, i.e. the output streams will pass through all console instances.

| Param | Type | Description | | --- | --- | --- | | [opts] | Object | | | [opts.textColor] | string | An html-like description of text color, e.g. 'black' or '#ed5616' | | [opts.backgroundColor] | string | An html-like description of background color | | [opts.fontSize] | number | A floating-point font point size | | [opts.transformStdout] | Transform | A function to transform output string being sent to stdout | | [opts.transformStderr] | Transform | A function to transform output strings being sent to stderr |

console.display([caramlview]) ⇒ Promise

Requests the console to be displayed (attached) on a caraml-core view. If no caramlview is provided, the default core view will be used.

Kind: instance method of Console
Returns: Promise - Promise which is resolved when the view is attached, or rejected with an error string

| Param | Type | Description | | --- | --- | --- | | [caramlview] | Object | A caraml-core view object obtained through var core = require('@liquidcore/caraml-core') |

console.hide() ⇒ Promise

Detaches a previously displayed console.

Kind: instance method of Console
Returns: Promise - Resolved when the view is attached, or rejected with an error string

console.getParent() ⇒ Object

Returns the parent caraml-core view

Kind: instance method of Console
Returns: Object - The caraml-core view to which the console is attached or undefined if not attached

console.getState() ⇒ string

Returns one of 'init', 'detached', 'attaching', 'attached', 'detaching'

Kind: instance method of Console
Returns: string - The current state of the console

"ready"

Emitted when the console view has been created and is ready to be attached to a caraml-core view.

Kind: event emitted by Console

"attached"

Emitted when the console view has been attached to a caraml-core view.

Kind: event emitted by Console

"detached"

Emitted when the console view has been detached from a caraml-core view.

Kind: event emitted by Console

"error"

Emitted on error

Kind: event emitted by Console

| Type | Description | | --- | --- | | string | A human-readable error string |

console.Transform ⇒ String

A function to transform output string, e.g. to add coloring with ANSI tags.

Kind: instance typedef of Console
Returns: String - Transformed string

| Param | Type | Description | | --- | --- | --- | | input | String | Input string |