-
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
1 parent
be47b48
commit 66b44b5
Showing
12 changed files
with
861 additions
and
43 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,52 @@ | ||
name: Deploy VitePress site to Pages | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: pages | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pnpm/action-setup@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Build with VitePress | ||
run: pnpm docs:build | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs/.vitepress/dist | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
name: Deploy | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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 |
---|---|---|
|
@@ -9,3 +9,5 @@ lib-cov | |
logs | ||
node_modules | ||
temp | ||
docs/.vitepress/dist | ||
docs/.vitepress/cache |
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
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 |
---|---|---|
@@ -1,7 +1,43 @@ | ||
# utils | ||
|
||
[](https://www.npmjs.com/package/@paunovic/utils) | ||
[](https://www.npmjs.com/package/@paunovic/utils) | ||
[](https://github.com/MilosPaunovic/utils/actions/workflows/ci.yml) | ||
|
||
A versatile collection of utility functions for simplifying JavaScript development. | ||
|
||
## 🚀 Features | ||
|
||
- 📝 Strings - Versatile utilities for generating and manipulating strings. | ||
- 🔢 Numbers - Utilities for generating, manipulating, and validating numbers. | ||
- 🧩 Various - A collection of utilities for diverse purposes. | ||
|
||
## 📦 Install | ||
|
||
```bash | ||
# Using npm to install as a development dependency | ||
npm install --save-dev @paunovic/utils | ||
|
||
# Using Yarn to add as a development dependency | ||
yarn add --dev @paunovic/utils | ||
|
||
# Using pnpm to add as a development dependency | ||
pnpm add --save-dev @paunovic/utils | ||
``` | ||
|
||
## 🪄 Usage | ||
|
||
```ts | ||
// Importing specific function using ESM syntax | ||
import { uniqueIdentifier } from '@paunovic/utils' | ||
|
||
// Importing specific function using CommonJS syntax | ||
const { uniqueIdentifier } = require('@paunovic/utils') | ||
|
||
// Seeing the imported function in action | ||
const ID = uniqueIdentifier() | ||
``` | ||
|
||
## License | ||
|
||
[MIT](./LICENSE) License © 2024 - PRESENT [Miloš Paunović](https://github.com/MilosPaunovic) | ||
[MIT](./LICENSE) Copyright © 2024 [Miloš Paunović](https://github.com/MilosPaunovic) |
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,28 @@ | ||
import { defineConfig } from 'vitepress' | ||
|
||
export default defineConfig({ | ||
title: 'utils', | ||
|
||
description: 'A versatile collection of utility functions for simplifying JavaScript development.', | ||
|
||
themeConfig: { | ||
nav: [ | ||
{ text: 'Guide', link: '/guide' }, | ||
{ text: 'Examples', items: [{ text: 'Strings', link: '/api/strings' }, { text: 'Numbers', link: '/api/numbers' }, { text: 'Various', link: '/api/various' }] }, | ||
], | ||
|
||
sidebar: [ | ||
{ text: 'Guide', items: [{ text: 'Getting Started', link: '/guide' }] }, | ||
{ text: 'Examples', items: [{ text: 'Strings', link: '/api/strings' }, { text: 'Numbers', link: '/api/numbers' }, { text: 'Various', link: '/api/various' }] }, | ||
], | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/MilosPaunovic/utils' }, | ||
], | ||
|
||
footer: { | ||
message: 'Made with ❤️ in Belgrade, Serbia.', | ||
copyright: 'Copyright © 2024 - present <a href="https://github.com/MilosPaunovic">Miloš Paunović</a>', | ||
}, | ||
}, | ||
}) |
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,9 @@ | ||
--- | ||
outline: deep | ||
prev: false | ||
next: false | ||
--- | ||
|
||
# 🔢 Numbers | ||
|
||
Utilities for generating, manipulating, and validating numbers. |
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,33 @@ | ||
--- | ||
outline: deep | ||
prev: false | ||
next: false | ||
--- | ||
|
||
# 📝 Strings | ||
|
||
Versatile utilities for generating and manipulating strings. | ||
|
||
## uniqueIdentifier | ||
|
||
Generates a unique 21-character identifier string. | ||
|
||
::: details | ||
```ts | ||
/** | ||
* @description | ||
* This function generates a unique identifier consisting of: | ||
* | ||
* - A single random lowercase letter at the beginning. | ||
* - A random alphanumeric string of 12 characters. | ||
* - The last 8 characters of the current timestamp in hexadecimal format. | ||
* | ||
* @returns {string} A unique 21-character identifier string. | ||
*/ | ||
``` | ||
::: | ||
```ts | ||
import { uniqueIdentifier } from '@paunovic/utils' | ||
|
||
const ID = uniqueIdentifier() // "k4a3e8b7f21bqwertyuio" | ||
``` |
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,9 @@ | ||
--- | ||
outline: deep | ||
prev: false | ||
next: false | ||
--- | ||
|
||
# 🧩 Various | ||
|
||
A collection of utilities for diverse purposes. |
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,35 @@ | ||
--- | ||
outline: deep | ||
prev: false | ||
next: false | ||
--- | ||
|
||
# Getting Started | ||
|
||
A versatile collection of utility functions for simplifying JavaScript development. | ||
|
||
## 📦 Install | ||
|
||
```bash | ||
# Using npm to install as a development dependency | ||
npm install --save-dev @paunovic/utils | ||
|
||
# Using Yarn to add as a development dependency | ||
yarn add --dev @paunovic/utils | ||
|
||
# Using pnpm to add as a development dependency | ||
pnpm add --save-dev @paunovic/utils | ||
``` | ||
|
||
## 🪄 Usage | ||
|
||
```ts | ||
// Importing specific function using ESM syntax | ||
import { uniqueIdentifier } from '@paunovic/utils' | ||
|
||
// Importing specific function using CommonJS syntax | ||
const { uniqueIdentifier } = require('@paunovic/utils') | ||
|
||
// Seeing the imported function in action | ||
const ID = uniqueIdentifier() | ||
``` |
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 @@ | ||
--- | ||
layout: home | ||
|
||
hero: | ||
name: utils | ||
|
||
tagline: "A versatile collection of utility functions for simplifying JavaScript development." | ||
|
||
actions: | ||
- theme: brand | ||
text: Getting Started | ||
link: /guide | ||
- theme: alt | ||
text: View on GitHub | ||
link: https://github.com/MilosPaunovic/utils | ||
|
||
features: | ||
- icon: 📝 | ||
title: Strings | ||
details: Versatile utilities for generating and manipulating strings. | ||
link: /api/strings | ||
|
||
- icon: 🔢 | ||
title: Numbers | ||
details: Utilities for generating, manipulating, and validating numbers. | ||
link: /api/numbers | ||
|
||
- icon: 🧩 | ||
title: Various | ||
details: A collection of utilities for diverse purposes. | ||
link: /api/various | ||
--- |
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
Oops, something went wrong.