-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c5998b1
Showing
12 changed files
with
3,061 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": ["@antfu"], | ||
"rules": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: [antfu] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm i -g pnpm @antfu/ni | ||
- run: nci | ||
- run: nr test --if-present | ||
- run: npx conventional-github-releaser -p angular | ||
env: | ||
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Node template | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# Nuxt generate | ||
dist | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# IDE | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Anthony Fu <https://github.com/antfu> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# log-editor | ||
|
||
[![NPM version](https://img.shields.io/npm/v/log-editor?color=a1b858&label=)](https://www.npmjs.com/package/log-editor) | ||
|
||
Fan of using `console.log` to debugger? Use your editor to inspect the log instead of scrolling the congested terminal. | ||
|
||
```diff | ||
- console.log(largeObject) | ||
+ console.logEditor(largeObject) | ||
``` | ||
|
||
## Install | ||
|
||
> Only works in Node.js environment. | ||
```bash | ||
npm i -D log-editor | ||
``` | ||
|
||
Add the following statement at the very beginning of your script: | ||
|
||
```ts | ||
import 'log-editor' | ||
``` | ||
|
||
Then use `console.logEditor` instead of `console.log` whenever you want to see the result in editor. It will launch the corresponsing editor powered by [`launch_editor`](https://github.com/yyx990803/launch-editor). | ||
|
||
```ts | ||
console.logEditor(largeObject) | ||
``` | ||
|
||
## Options | ||
|
||
### Named log | ||
|
||
Pass a second argument to specify the key. When calling same key for multiple times, the same temp file will be used and overrides the previous content. | ||
|
||
```ts | ||
console.logEditor(largeObject, 'foo') | ||
``` | ||
|
||
To accumulate the result of multiple calls, setting the `override` to false. | ||
|
||
```ts | ||
console.logEditor('message 1', 'key', { override: false }) | ||
console.logEditor('message 2', 'key', { override: false }) | ||
``` | ||
|
||
## Sponsors | ||
|
||
<p align="center"> | ||
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg"> | ||
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/> | ||
</a> | ||
</p> | ||
|
||
## License | ||
|
||
[MIT](./LICENSE) License © 2021 [Anthony Fu](https://github.com/antfu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "log-editor", | ||
"version": "0.0.0", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"funding": "https://github.com/sponsors/antfu", | ||
"author": "Anthony Fu <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/antfu/log-editor/issues" | ||
}, | ||
"homepage": "https://github.com/antfu/log-editor#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/antfu/log-editor.git" | ||
}, | ||
"keywords": [], | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"prepublishOnly": "nr build", | ||
"dev": "nr build --watch", | ||
"start": "esno src/index.ts", | ||
"build": "tsup src/index.ts --format cjs,esm --dts", | ||
"release": "bumpp --commit --push --tag && pnpm publish", | ||
"lint": "eslint \"{src,test}/**/*.ts\"", | ||
"lint:fix": "nr lint -- --fix" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^0.6.2", | ||
"@antfu/ni": "^0.5.5", | ||
"@types/node": "^14.14.37", | ||
"bumpp": "^6.0.6", | ||
"eslint": "^7.23.0", | ||
"esno": "^0.5.0", | ||
"tsup": "^4.8.21", | ||
"typescript": "^4.2.3" | ||
}, | ||
"dependencies": { | ||
"launch-editor": "^2.2.1", | ||
"tempy": "^1.0.1" | ||
} | ||
} |
Oops, something went wrong.