• Stars
    star
    615
  • Rank 72,947 (Top 2 %)
  • Language
    JavaScript
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A react renderer for browser's dev console

Konsul Logo

Konsul is an abstraction of the browser's console that comes with a React renderer. It offers text styling, images, style inheritance, buttons with click interaction, etc. inside the browsers dev console.

See the live demo here

Travis npm js-semistandard-style

Usage

With react

Install konsul and react-konsul using npm:

npm install konsul react-konsul react

The following code demonstrates how you can use konsul with react.

import createKonsul from 'konsul';
import renderToKonsul from 'react-konsul';

// Create an instance of konsul
const konsul = createKonsul();

// Render react elements to the browser console!
renderToKonsul(<text style={{ color: 'red', fontWeight: 'bold' }}>Hello world!</text>, konsul);

This is what the result will look like:

Konsul "Hello world" example

See more examples here with the live demo.

React element types

text

This node is the only node type that accepts strings and numbers as children.

Prop Type Description
style TextStyle A plain javascript object whose keys are camel cased property names with their property value.
children `(Text string

image

A Konsul node for displaying images from a url.

Prop Type Description
style ImageStyle A plain javascript object whose keys are camel cased property names with their property value.
source string The URL of the image.

button

An interactive node that responds to clicks. Note that it only works on chrome for now.

Prop Type Description
onClick function Called when the user clicks on the element.
label string The label of the button. It will replace all the characters that are not acceptable for the name of a function with _.

group

All the children of a Group element will be wrapped inside console.group.

Prop Type Description
children Node[] All kind of elements except strings and numbers are accepted.

container

This node has no specific behaviour. It works as a container and renders all its children.

Prop Type Description
children Node[] All kind of elements except strings and numbers are accepted.

Without react

Install konsul via npm:

npm install konsul

The following code is the previous example but without react:

import createKonsul from 'konsul';

// Create an instance of konsul
const konsul = createKonsul();

// Create a text
const text = konsul.text({
  style: {
    color: 'red',
    fontWeight: 'bold'
  }
});

// Append a text to the text element
text.append('Hello world!');

// Append the text element to konsul
konsul.append(text);

// Render to console. The subsequent renders will occur automatically for example by updating the style or children.
konsul.render();

License

Released under the MIT License

More Repositories

1

react-native-copilot

Step-by-step walkthrough tooltip for your react native app
TypeScript
2,002
star
2

made-in-iran

A list of cool projects made in Iran
TypeScript
833
star
3

vidact

A compiler that converts React-compatible codes to VanillaJS with no Virtual DOM
TypeScript
764
star
4

grafgiti

Vandalize your github contributions wall.
JavaScript
412
star
5

react-native-loader

A collection of animated spinners for React Native
JavaScript
393
star
6

racket

A complete starting app for developing universal React/Redux web apps with generators, best practices and more
JavaScript
290
star
7

react-native-easy-dnd

Drag and drop with react-native made simple
TypeScript
125
star
8

angular-persian

🌏 Persian tools for angular.js
CoffeeScript
98
star
9

lithree.js

🔮 Lightweight 3D WebGL framework written in ES6
JavaScript
42
star
10

react-native-ximage

An alternative to react native's Image component with cache support.
JavaScript
31
star
11

react-use-context-selector

Context selector hook for React
TypeScript
29
star
12

openbabel-node

OpenBabel Bindings for Node.js
C++
26
star
13

php-jalali-extension

A php extension for Jalali dates
Shell
20
star
14

DateTimeBundle

A Symfony2 Bundle to format DateTime to string according to a Calendar and a Datepicker FormType.
JavaScript
16
star
15

telegram-vanilla-client

TypeScript
15
star
16

react-markdown-native

Render Markdown as React native components
JavaScript
14
star
17

volley

A Web-Based Volleyball game
JavaScript
12
star
18

mol3d

A chemical visualization tool on top of WebGL
JavaScript
10
star
19

Razi

A new scientific chemistry library for java.
Java
10
star
20

pasoor

♠️ A simple API for game cards.
JavaScript
9
star
21

molcanvas.js

A WebGL molecule renderer and editor
JavaScript
7
star
22

goron

Yet another graphical database management tool [WIP]
JavaScript
7
star
23

muzik

A simple music player made with react. I made it for an "interview" test but never joined the company.
JavaScript
7
star
24

vscode-shopify-i18n

TypeScript
6
star
25

shelem

♥️ Shelem (a perisan card game) made with react native
JavaScript
6
star
26

mohebifar.ir

Mohamad Mohebifar's blog
HTML
4
star
27

openmm-transformer

A cleaner way to manage custom forces in OpenMM
Python
4
star
28

muniranians

JavaScript
4
star
29

GayPI

:octocat: Isomorphic JavaScript API wrapper around the Github API v3.
JavaScript
4
star
30

truck-cli

JavaScript
3
star
31

openmm-buckingham-plugin

C++
3
star
32

chem.js

A molecular modeling JavaScript framework.
JavaScript
3
star
33

CalendarBundle

A Symfony2 Bundle to show times with any type of calendar (Persian هجری, Gregorian, ...)
PHP
2
star
34

fix-pdb

A simple script for fixing broken PDB files
Python
2
star
35

pybel-orca

Python code around pybel to write inputs and read outputs of the ab initio package, ORCA
Python
2
star
36

cssTransit

Javascript CSS Transition
JavaScript
1
star
37

react-konsole

1
star
38

node-parsi-payment

A Node.js module providing access to the Iran's Shetab Payment API
JavaScript
1
star
39

smirnoff

The SMIRks Native Open Force Field (SMIRNOFF)
Jupyter Notebook
1
star
40

janshop

Simple RESTful django content management framework
HTML
1
star