-
Notifications
You must be signed in to change notification settings - Fork 0
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 88c4632
Showing
21 changed files
with
25,224 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,32 @@ | ||
name: CI | ||
on: [push] | ||
jobs: | ||
build: | ||
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node: ['10.x', '12.x', '14.x'] | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install deps and build (with cache) | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
- name: Test | ||
run: npm run test -- --ci --coverage --maxWorkers=2 | ||
|
||
- name: Build | ||
run: npm run build |
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,12 @@ | ||
name: size | ||
on: [pull_request] | ||
jobs: | ||
size: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI_JOB_NUMBER: 1 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: andresz1/size-limit-action@v1 | ||
with: | ||
github_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,6 @@ | ||
*.log | ||
.DS_Store | ||
node_modules | ||
dist | ||
console.js | ||
test |
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) 2023 NoBody | ||
|
||
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,69 @@ | ||
<h1 align=center> | ||
<br> | ||
TASKWIZARD | ||
</h1> | ||
|
||
<p align=center> | ||
A versatile package containing useful code snippets for simple tasks. | ||
</p> | ||
|
||
|
||
## What is TaskWizard? | ||
|
||
TaskWizard is a powerful and versatile package designed to enhance your development experience. It offers a collection of useful functions and utilities that can be easily integrated into your projects, providing a wide range of functionalities for developers. | ||
|
||
## Installation | ||
|
||
To install TaskWizard, you can use npm: | ||
|
||
```bash | ||
npm install taskwizard | ||
``` | ||
|
||
## Features | ||
|
||
TaskWizard comes with several functions and utilities for various tasks, including: | ||
|
||
### Discord Colors | ||
|
||
- `discordColors(): string[]`: Retrieve an array of Discord colors. | ||
|
||
### Discord Emoji Validation | ||
|
||
- `isDiscordEmoji(emoji: string): boolean`: Check if a text string represents a valid Discord emoji. | ||
|
||
### File Search | ||
- `searchFilesRecursive(folderPath: string, allowedExtensions?: string[]): string[]`: Recursively search for files with specified extensions in a folder and its subfolders. | ||
|
||
### Fetch Buffer | ||
|
||
- `fetchBuffer(url: string, init?: RequestInit): Promise<FetchBufferResult>`: Fetch buffer content from a URL. | ||
|
||
### Country Flags Data | ||
|
||
- `getInfoFlag(flag: string): any`: Retrieve information related to a specific country flag. | ||
- `isValidCode(code: string): boolean`: Check if a provided code is a valid country code. | ||
- `isValidEmoji(emoji: string): boolean`: Check if a provided emoji is a valid country flag emoji. | ||
- `isValidFlagName(name: string): boolean`: Check if a provided name is a valid country flag name. | ||
- `isValidFlag(flag: string): boolean`: Check if a provided input represents a valid country flag. | ||
- `getLanguagesFromCode(code: string): string[]`: Get languages spoken in a specific country using its country code. | ||
- `getLanguagesFromEmoji(emoji: string): string[]`: Get languages spoken in a specific country using its flag emoji. | ||
|
||
### Time and Number Utilities | ||
|
||
- `formatTimeFromSeconds(sec: number): string`: Convert seconds to a formatted string representing the time duration. | ||
- `compactNumber(number: number): string`: Format a number to a compact representation with an appropriate unit suffix. | ||
- `calculatePercentageBar(options: CalculatePercentageBarOptions): string`: Calculate the completion percentage and visually represent it using bars. | ||
- `diffHours(dt2: Date, dt1: Date): number`: Calculate the difference in hours between two dates. | ||
|
||
### Color Code Validation | ||
|
||
- `isHex(colorCode: string): boolean`: Check if a given text represents a valid hexadecimal color code. | ||
|
||
### Discord Invite Link Validation | ||
|
||
- `isDiscordInviteLink(text: string): boolean`: Check if a given text contains a Discord invite link. | ||
|
||
### Email Address Validation | ||
|
||
- `isValidEmail(email: string): boolean`: Check if a given text represents a valid email address. |
Oops, something went wrong.
88c4632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤑🤑