0.2.9 • Published 8 months ago

@toolsntuts/utils v0.2.9

Weekly downloads
-
License
-
Repository
github
Last release
8 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

8 months ago

0.2.8

8 months ago

0.2.7

8 months ago

0.2.6

8 months ago

0.2.3

9 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.1.8

9 months ago

0.1.9

9 months ago

0.2.2

9 months ago

0.1.6

9 months ago

0.1.2

10 months ago

0.1.4

10 months ago

0.1.5

10 months ago

0.1.0

10 months ago

0.1.1

10 months ago

0.0.8

10 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago