Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
7PH committed Jan 16, 2024
0 parents commit 75ef0e0
Show file tree
Hide file tree
Showing 15 changed files with 7,705 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
env:
browser: true
es2021: true
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
parserOptions:
ecmaVersion: latest
parser: '@typescript-eslint/parser'
sourceType: module
plugins:
- '@typescript-eslint'
rules:
indent:
- error
- 4
- SwitchCase: 1
linebreak-style:
- error
- unix
quotes:
- error
- single
semi:
- error
- always
30 changes: 30 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: ['master']
pull_request:
branches: ['master']

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
15 changes: 15 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'size'
on:
pull_request:
branches:
- master
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 }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
coverage
lib
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 140,
"tabWidth": 4,
"singleQuote": true
}
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
**beautify-url** is an opinionated, security-oriented library that transforms URLs into shorter, more aesthetic forms without compromising their functionality or security.

## Installation

```bash
npm i --save beautify-url
# or
yarn add beautify-url
```

## Usage

Import the `beautifyUrl` function and use it to transform URLs:

```javascript
import beautifyUrl from 'beautify-url';

console.log(beautifyUrl('https://google.com'));
// Outputs: 'google.com'

console.log(beautifyUrl('ftp://google.com'));
// Outputs: 'ftp://google.com'

console.log(beautifyUrl('https://google.com?q=long&with=very-long-last-value'));
// Outputs: 'google.com?[..]value'

console.log(beautifyUrl('not an URL'));
// Outputs: 'not an URL'
```

## Contributing

Having trouble? Found a bug? Want to contribute? Any kind of contribution is welcome. If you have any questions, please open an issue or create a pull request.

## License

This project is licensed under the MIT License.
6 changes: 6 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};
1 change: 1 addition & 0 deletions dist/beautify-url.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'src/**/*'
],
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/lib/'],
coverageProvider: 'v8',
verbose: true,
};
Loading

0 comments on commit 75ef0e0

Please sign in to comment.