Skip to content

Commit 94aaaff

Browse files
committed
🧬 new life
1 parent 50fb3ef commit 94aaaff

35 files changed

+920
-477
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

.gitattributes

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Auto detect text files and perform LF normalization
2-
* text=auto
3-
4-
# JS files must always use LF for tools to work
5-
*.js eol=lf
1+
# based on Sindre Sorhus `node-module-boilerplate`:
2+
# https://github.com/sindresorhus/node-module-boilerplate/blob/9b8dc81a35acfbd3b75f7f19c9679e4f83b36df3/.gitattributes
3+
* text=auto eol=lf

.gitignore

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
/node_modules
2-
/.settings
3-
/examples
1+
node_modules/
2+
coverage/
3+
4+
# as Sindre Sorhus
5+
yarn.lock
6+
7+
*.js
8+
*.d.ts

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# for open-source libraries — don't use a lock file
2+
# - 😃 as Sindre Sorhus
3+
package-lock=false

LICENSE

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The MIT License (MIT)
1+
MIT License
22

3-
Copyright (c) 2015 Antonio Stoilkov
3+
Copyright (c) 2022 Antonio Stoilkov hello@astoilkov.com https://astoilkov.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

README.md

+33-137
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
1-
# console.message
1+
# `console-powers`
22

3-
Console messages for cool kids
3+
> Console messages for cool kinds
44
5-
## Examples
5+
<!--
6+
[![Gzipped Size](https://img.shields.io/bundlephobia/minzip/{{data.name}})](https://bundlephobia.com/result?p={{data.name}})
7+
[![Build Status](https://img.shields.io/github/actions/workflow/status/astoilkov/{{data.name}}/main.yml?branch=main)](https://github.com/astoilkov/{{data.name}}/actions/workflows/main.yml)
68
7-
### Cool kids
89
9-
```javascript
10-
console.message().text('Cool kids', {
11-
fontSize: 200,
12-
color: 'hsl(330, 100%, 50%)',
13-
textShadow: '0 2px 0 hsl(330, 100%, 25%), 0 3px 2px hsla(330, 100%, 15%, 0.5), /* next */ 0 3px 0 hsl(350, 100%, 50%), 0 5px 0 hsl(350, 100%, 25%), 0 6px 2px hsla(350, 100%, 15%, 0.5), /* next */ 0 6px 0 hsl(20, 100%, 50%), 0 8px 0 hsl(20, 100%, 25%), 0 9px 2px hsla(20, 100%, 15%, 0.5), /* next */ 0 9px 0 hsl(50, 100%, 50%), 0 11px 0 hsl(50, 100%, 25%), 0 12px 2px hsla(50, 100%, 15%, 0.5), /* next */ 0 12px 0 hsl(70, 100%, 50%), 0 14px 0 hsl(70, 100%, 25%), 0 15px 2px hsla(70, 100%, 15%, 0.5), /* next */ 0 15px 0 hsl(90, 100%, 50%), 0 17px 0 hsl(90, 100%, 25%), 0 17px 2px hsla(90, 100%, 15%, 0.5)',
14-
fontFamily: '\'Permanent Marker\', cursive'
15-
}).print();
10+
## Install
11+
12+
```bash
13+
npm install {{data.name}}
1614
```
1715
18-
### Used in [jsblocks](http://jsblocks.com)
16+
## Why
17+
18+
## Usage
19+
20+
## API
21+
22+
## Alternatives
23+
24+
## Related
1925
20-
```javascript
26+
## Example
27+
28+
```ts
29+
consolePrint(
30+
consoleText('Cool kids', {
31+
fontSize: 200,
32+
color: 'hsl(330, 100%, 50%)',
33+
textShadow: '0 2px 0 hsl(330, 100%, 25%), 0 3px 2px hsla(330, 100%, 15%, 0.5), /* next */ 0 3px 0 hsl(350, 100%, 50%), 0 5px 0 hsl(350, 100%, 25%), 0 6px 2px hsla(350, 100%, 15%, 0.5), /* next */ 0 6px 0 hsl(20, 100%, 50%), 0 8px 0 hsl(20, 100%, 25%), 0 9px 2px hsla(20, 100%, 15%, 0.5), /* next */ 0 9px 0 hsl(50, 100%, 50%), 0 11px 0 hsl(50, 100%, 25%), 0 12px 2px hsla(50, 100%, 15%, 0.5), /* next */ 0 12px 0 hsl(70, 100%, 50%), 0 14px 0 hsl(70, 100%, 25%), 0 15px 2px hsla(70, 100%, 15%, 0.5), /* next */ 0 15px 0 hsl(90, 100%, 50%), 0 17px 0 hsl(90, 100%, 25%), 0 17px 2px hsla(90, 100%, 15%, 0.5)',
34+
})
35+
)
36+
```
37+
38+
```ts
39+
consolePrint(consoleText('Arguments mismatch:'))
2140
console.message()
2241
.span({ fontWeight: 'bold'})
2342
.text('Arguments mismatch:', { background: 'yellow' })
@@ -32,127 +51,4 @@ console.message()
3251
.print();
3352
```
3453
35-
### Grouping awesomeness
36-
37-
```javascript
38-
console.message()
39-
.group()
40-
.text('Error occurred while executing code', { color: 'red', fontSize: 24 })
41-
.group(false)
42-
.text('For more information expand the group', { color: 'green' })
43-
.line()
44-
.text('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.')
45-
.print();
46-
```
47-
48-
## Browser support
49-
50-
The project supports Chrome, Firefox, Safari, Opera, IE7+.
51-
It fallbacks to messages without styles when they are not supported.
52-
53-
## API
54-
55-
### text(text:string)
56-
57-
Appends a text to the current message. All styles in the current span are applied.
58-
59-
```javascript
60-
console.message().text('this is equal to just calling console.log()').print();
61-
62-
console.message()
63-
.text('Error: ', { color: 'red' })
64-
.text('this is more useful scenario')
65-
.print();
66-
```
67-
68-
### element(element:HTMLElement)
69-
70-
Adds an interactive DOM element to the output.
71-
72-
```javascript
73-
console.message()
74-
.text('Hey take a look at the page body')
75-
.element(document.body)
76-
.print();
77-
```
78-
79-
### object(object:Object)
80-
81-
Adds an interactive object tree to the output.
82-
83-
```javascript
84-
console.message()
85-
.text('Hey take a look at the this object ')
86-
.object({ firstName: 'John', lastName: 'Doe' })
87-
.print();
88-
```
89-
90-
### span(styles:Object)
91-
92-
Starts a span with particular style and all appended text after it will use the style.
93-
94-
```javascript
95-
console.message()
96-
.span({ color: 'red' })
97-
.text('this is red! ')
98-
.span({ color: 'green' })
99-
.text('this is green! ')
100-
.spanEnd()
101-
.text('this is again red!')
102-
.spanEnd()
103-
.print();
104-
```
105-
106-
### spanEnd()
107-
108-
Ends the current span styles and backs to the previous styles or the root if there are no other parents.
109-
Take a look at the example above.
110-
111-
### group(expanded:boolean = true)
112-
113-
Begins a group. By default the group is expanded. Provide false if you want the group to be collapsed.
114-
115-
```javascript
116-
console.message()
117-
// pass false if you want to create a collapsed group
118-
.group()
119-
.text('The group header text')
120-
.line()
121-
.text('The group content')
122-
.groupEnd()
123-
.print();
124-
```
125-
126-
### groupEnd()
127-
128-
Ends the group and returns to writing to the parent message.
129-
130-
```javascript
131-
console.message()
132-
.group(false)
133-
.text('group')
134-
.groupEnd()
135-
.text('Outside of group')
136-
.print();
137-
```
138-
139-
### line()
140-
141-
Adds a new line to the output.
142-
143-
```javascript
144-
console.message()
145-
.text('first line')
146-
.line()
147-
.text('second line')
148-
.print();
149-
```
150-
151-
### print()
152-
153-
Prints the message to the console.
154-
Every message chaining should end with `print`. No `print()` call no message.
155-
156-
```javascript
157-
console.message().text('just text').print();
158-
```
54+
-->

bower.json

-18
This file was deleted.

0 commit comments

Comments
 (0)