This extension generates random data directly into VS Code. It uses the great ChanceJS library written by Victor Quinn and was inspired by the Random extension for Atom.
This extension can be installed with one the following methods:
- Launch the Command Pallete (Cmd+Shift+P / Ctrl+Shift+P) and type
Extensions: Install Extensions
. Typevscode-random
in the Side Bar search input. Click the install button and reload VS Code. - Click the Extensions icon in the View Bar. Type
vscode-random
in the Side Bar search input. Click the install button and reload VS Code. - Launch VS Code Quick Open (Cmd+P / Ctrl+P). Paste the command
ext install vscode-random
and press Enter.
Launch the Command Pallete (Cmd+Shift+P / Ctrl+Shift+P) and type random
to view all the available data generators. Select one of them and press Enter.
Random values generation is also supported when using multiple editors.
vscodeRandom.contextMenu.enabled
: Enable/disable the context menu for the available data generators (enabled by default).vscodeRandom.multipleEditors.generateDifferentValues
: Generate different values when using multiple editors (true by default).vscodeRandom.date.shortFormat
: Date format used by the random short date command ("DD/MM/YYYY" by default). Refer to dayjs documentation on how to config your custom format.vscodeRandom.date.longFormat
: Date format used by the random long date command ("dddd, DD MMMM YYYY" by default). Refer to dayjs documentation on how to config your custom format.vscodeRandom.time.use24h
: Use 24H or AM/PM in random time commands (true by default)
extension.resetSeed
: Reset seed - Initialize random generation library with a new seed. If no new seed is provided, the library will be reinitialized with the default options.extension.randomByte
: Random byte - Generates an integer between 0 and 255extension.randomShort
: Random short - Generates an integer between 0 and 65535extension.randomInt
: Random integer - Generates an integer between 0 and 4294967295extension.randomLong
: Random long - Generates an integer between 0 and 9007199254740992extension.randomIntCustomRange
: Random integer (custom range) - Generates a random integer within a given custom rangeextension.randomGuid
: Random guid - Generates a guidextension.randomLetters,
: Random letters (custom length) - Generates a string with a length defined by user inputextension.randomDigits,
: Random digits (custom length) - Generates a string with a length defined by user inputextension.randomLettersDigits,
: Random letters and digits (custom length) - Generates a string with a length defined by user inputextension.randomLowercaseLetters,
: Random lowercase letters (custom length) - Generates a string with a length defined by user inputextension.randomLowercaseLettersDigits,
: Random lowercase letters and digits (custom length) - Generates a string with a length defined by user inputextension.randomUppercaseLetters,
: Random uppercase letters (custom length) - Generates a string with a length defined by user inputextension.randomUppercaseLettersDigits,
: Random uppercase letters and digits (custom length) - Generates a string with a length defined by user inputextension.randomSampleFromInput
: Random sample from input - Selects a random string from a comma-separated set of valuesextension.randomName
: Random name - Generates a random name (first and last name)extension.randomStreetAddress
: Random street address - Generates a random street addressextension.randomCity
: Random city - Generates a random city nameextension.randomCountryCode
: Random country code - Returns a random country codeextension.randomCountryName
: Random country name - Returns a random country nameextension.randomPhoneNumber
: Random phone number - Generates a random phone numberextension.randomEmail
: Random email - Generates a random email with a random domainextension.randomIP
: Random IP - Generates a random IP addressextension.randomIPv6
: Random IPv6 - Generates a random IPv6 addressextension.randomUrl
: Random Url - Generates a random Urlextension.randomHexColor
: Random hexadecimal color - Generates a random hexadecimal colorextension.randomRgbColor
: Random RGB color - Generates a random RGB colorextension.randomIban
: Random IBAN - Generates a random IBANextension.randomRegEx
: Random Regular Expression - Generates random strings that match a given regular expressionextension.randomDateShort
: Random Date (short format) - Generates a random date (short format)extension.randomDateLong
: Random Date (long format) - Generates a random date (long format)extension.randomDateISO
: Random Date (ISO format) - Generates a random date (ISO format)extension.randomTime
: Random Time - Generates a random timeextension.randomDateTime
: Random DateTime - Generates a random date with time
You can check all the changes in the change log here.
Problems with the extension? Suggestions for improvements? Please create an issue or submit a PR on the Github repository. You can also ping me on twitter.
MIT © Jorge Rebocho