jtSnippets

Snippets from @JaviertINC libraries to speed up your development!
Read this in Spanish
Features
Code Snippets

Complete collection of snippets organized by library to speed up your development with @JaviertINC utilities.
Core
Snippets to import and configure JT libraries:
jt-core-import - Import all JT libraries using ES6 modules
jt-core-setup - Configure the jt constant with all libraries
Basic
Basic programming snippets for JavaScript/TypeScript:
jt-cl - Console log statement
jt-fn - Function declaration (with TypeScript types)
jt-af - Arrow function (with TypeScript types)
jt-int - Interface declaration
jt-ta - Type alias
jtEssentials

Complete snippets for jt@essentials with all utilities organized by module:
Data Module (5 snippets):
jt-essentials-data-stringify - Data serialization with optional encryption
jt-essentials-data-parse - Data deserialization with optional decryption
jt-essentials-data-encrypt - AES encryption
jt-essentials-data-decrypt - AES decryption
jt-essentials-data-usid - Generation of unique static IDs
Text Module (6 snippets):
jt-essentials-text-capitalize - Capitalize words
jt-essentials-text-camelCase - Convert to camelCase
jt-essentials-text-kebabCase - Convert to kebab-case
jt-essentials-text-snakeCase - Convert to snake_case
jt-essentials-text-reverse - Reverse text
jt-essentials-text-normalize - Normalize text (remove accents)
Date Module (13 snippets):
jt-essentials-date-format - Format dates
jt-essentials-date-parseTimezone - Convert time zones
jt-essentials-date-daysBetween - Calculate days between dates
jt-essentials-date-time-add - Add time to a date
jt-essentials-date-time-sub - Subtract time from a date
jt-essentials-date-days-add - Add days to a date
jt-essentials-date-days-sub - Subtract days from a date
jt-essentials-date-months-add - Add months to a date
jt-essentials-date-months-sub - Subtract months from a date
jt-essentials-date-years-add - Add years to a date
jt-essentials-date-years-sub - Subtract years from a date
jt-essentials-date-getAge - Calculate age
jt-essentials-date-getDayOfWeek - Get day of the week name
jt-essentials-date-getMonth - Get month name
Util Module (9 snippets):
jt-essentials-util-mask - Mask text
jt-essentials-util-blob - Create blob URLs
jt-essentials-util-download - Download files
jt-essentials-util-isMobile - Detect mobile devices
jt-essentials-util-theme-get - Get configured theme
jt-essentials-util-theme-set - Set theme
jt-essentials-util-theme-browser - Get browser theme
jt-essentials-util-lang-get - Get configured language
jt-essentials-util-lang-set - Set language
jt-essentials-util-lang-browser - Get browser language
Gen Module (4 snippets):
jt-essentials-gen-password - Generate passwords
jt-essentials-gen-loremIpsum - Generate Lorem Ipsum text
jt-essentials-gen-ip-v4 - Generate IPv4 addresses
jt-essentials-gen-ip-v6 - Generate IPv6 addresses
Log Module (6 snippets):
jt-essentials-log-setup - Configure logging
jt-essentials-log-get - Get logs
jt-essentials-log-push - Add log entries
jt-essentials-log-clear - Clear logs
jt-essentials-log-remove - Remove all logs
jt-essentials-log-export - Export logs to JSON
jtCedula

Complete snippets for jt@cedula with all utilities for Chilean RUN/RUT and document numbers:
Run Module (6 snippets):
jt-cedula-run-validate - Validate RUN/RUT
jt-cedula-run-dv - Calculate RUN/RUT check digit
jt-cedula-run-format - Format RUN/RUT
jt-cedula-run-unformat - Unformat RUN/RUT
jt-cedula-run-generate - Generate random RUN/RUT
jt-cedula-run-getAge - Calculate age from RUN/RUT
DocumentNumber Module (4 snippets):
jt-cedula-documentNumber-unformat - Unformat document number
jt-cedula-documentNumber-format - Format document number
jt-cedula-documentNumber-validate - Validate document number
jt-cedula-documentNumber-generate - Generate random document number

Complete snippets for jt@transform with all transformation utilities:
Numbers Module (2 snippets):
jt-transform-numberToLetter - Convert numbers to Spanish letters
jt-transform-letterToNumber - Convert Spanish letters to numbers
Size Module (2 snippets):
jt-transform-size-format - Format bytes to readable size
jt-transform-size-unformat - Convert readable size to bytes
NATO Module (2 snippets):
jt-transform-nato-format - Convert text to NATO phonetic alphabet
jt-transform-nato-unformat - Convert NATO phonetic alphabet to text
Morse Module (2 snippets):
jt-transform-morse-format - Convert text to Morse code
jt-transform-morse-unformat - Convert Morse code to text
Braille Module (2 snippets):
jt-transform-braille-format - Convert text to Braille
jt-transform-braille-unformat - Convert Braille to text
Date Module (2 snippets):
jt-transform-date-weekDay - Get localized weekday name
jt-transform-date-month - Get localized month name
Color Module (6 snippets):
jt-transform-color-toRGB - Convert color to RGB object
jt-transform-color-toRGBA - Convert color to RGBA object
jt-transform-color-toHex - Convert color to hexadecimal
jt-transform-color-toCMYK - Convert color to CMYK
jt-transform-color-toCMYB - Convert color to CMYB (alias for CMYK)
jt-transform-color-toAll - Convert color to all formats
jtYxtus

Complete snippets for jt@yxtus with text-to-HTML parsing utilities:
Parse Module (1 snippet):
jt-yxtus-parse - Parse text to HTML using jtYxtus
How to use:
- Install the jtSnippets extension
- In any JavaScript/TypeScript file, type "jt-" to see all available snippets
- Select the desired snippet and press Tab to complete
- Parameters with
${1:param} can be navigated with Tab
Note: All snippets have both full and short versions:
jt-essentials-data-stringify → jt-ess-data-stringify
jt-cedula-run-validate → jt-ced-run-validate
jt-transform-size-format → jt-trans-size-format
jt-yxtus-parse → jt-yxt-parse
Requirements
This extension requires you to have @JaviertINC libraries installed, either one or all:
npm install javiertinc@essentials javiertinc@cedula javiertinc@transform javiertinc@yxtus
pnpm install javiertinc@essentials javiertinc@cedula javiertinc@transform javiertinc@yxtus
Important
- Snippets are optimized for use with the configured
jt constant (you can use the jt-core-setup snippet to configure it).
- Make sure to import the libraries you will use before using the snippets.
- You can use one or all libraries at once.
Enjoy programming with jtSnippets!