0.2.9 • Published 3 months ago

@toolsntuts/utils v0.2.9

Weekly downloads
-
License
-
Repository
github
Last release
3 months ago

Svelte Util Functions

It makes use of the following technologies

Installation

npm i @toolsntuts/utils

Configuration

Update your vite.config.ts file in your sveltekit application with the following

import { defineConfig } from 'vitest/config';
import { sveltekit } from '@sveltejs/kit/vite';

export default defineConfig({
  plugins: [sveltekit()],
  server: {
    fs: {
      allow: [
        'dist',          // Allow access to the dist folder
        '.',             // Allow access to the project root
        'src'            // Allow access to src if needed
      ]
    }
  }
});

timeAgo()

Accepts number input and returns string output

const date = +new Date("November 2, 2024")
const time = timeAgo(date) // returns 1 day ago

slugify()

Accepts string input and returns string output

const email = "example@test.com"
const slugified = slugify(email) // returns exampletestcom

getFolderName()

Wrapper for slugify

emailToTag()

Accepts email string returns a tag string

const email = "example@test.com"
const slugified = emailToTag(email) // returns @example

mediaUrlFormat()

Accepts email string returns a tag string

const media = "<MEDIA_FILE_NAME>.jpg"
const urlFormat = mediaUrlFormat(media) // returns .jpg
0.2.9

3 months ago

0.2.8

4 months ago

0.2.7

4 months ago

0.2.6

4 months ago

0.2.3

5 months ago

0.2.5

4 months ago

0.2.4

5 months ago

0.1.8

5 months ago

0.1.9

5 months ago

0.2.2

5 months ago

0.1.6

5 months ago

0.1.2

6 months ago

0.1.4

6 months ago

0.1.5

6 months ago

0.1.0

6 months ago

0.1.1

6 months ago

0.0.8

6 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago