-
Notifications
You must be signed in to change notification settings - Fork 9
Tools
A set of useful and handy helpers.
Executes a line of (JavaScript) code.
Enter $help
to open the list of available functions and modules.
The CancellationToken object, to check the current progress state.
$cancel.isCancellationRequested
Stores the content of the active text editor, if available.
$alert( $e )
The Progress object, to control the current progress state ... s. withProgress().
$progress.report({ message: 'Hello, TM!' })
Shows a (warning) popup.
$alert("Hello, TM!")
Handles a value as string and returns the ASCII (codes).
$asc("T")
Converts a value to a Base64 string.
$base64("mkloubert:P@ssword123!")
Handles a value as string and hashes with bcrypt.
$bcrypt("MyP@ssword123!", 10)
Handles a value and a hash as strings and checks, with bcrypt, if they match.
$bcryptcomp("MyP@ssword123!", "$2a$10$JemKONAF8YtWJR88jIh52O7a2011ntsCJCzUwMC.hMIbQb1jylLs.")
Beautifies the code in the active editor and opens the result in a new one.
The following languages are supported:
- CSS
- HTML
- JavaScript
- JSON
- XML
$beautify
Converts a value to a Buffer, if needed.
$buff('Hello, TM!', 'utf8')
Copies a value to clipboard or returns the current (text) value, if no argument is defined.
$cb("TM+MK")
Executes a Visual Studio Code command.
$cmd("editor.action.selectAll")
Converts CMYK color from or to hex.
$cmyk(167, 255, 4)
Handles a value as string to display it in a webview with syntax highlight.
$code("const TM = \'1979-09-05\';\\n\\nalert(TM);", "javascript")
Compiles the code in the active editor and opens the result in a new one.
The following languages are supported:
- CoffeeScript
- LESS
- Pug
$compile
Handles data as string in CSV format and displays them.
$csv( $GET('https://example.com/file.csv') )
Starts a HTTP DELETE request.
$DELETE("https://example.com/users/19861222")
Returns a list of emojis, by using an optional filter.
$emojis("heart")
Handles data as Excel workbook and displays its data.
$excel("https://example.com/myWorkbook.xlsx")
Executes the code in the currently running editor.
$exec
Returns a full path.
$full("dir1/subDir1_1/myFile.txt")
Starts a HTTP GET request.
$GET("https://example.com/users/19790905")
Generates a GUID.
$guid
Hashes a value.
$hash("sha1", "TM+MK")
Converts HSL color from or to hex.
$hsl(1, 2, 3)
Handles a value as string, and decodes the HTML entities.
$htmldec("5979 > 23979")
Handles a value as string, and encodes the HTML entities.
$htmlenc("<tm>")
Handles a value as image (or image url) and displays it.
$img( "https://www.e-go-mobile.com/site/assets/files/1965/batch_ego_life_website_weiss-1600x550px.jpg" )
Handles a value as string and inserts it into the selected text (or cursor) of the currently opened text editor.
$insert( $uuid )
Tries to detect the public IP address.
$ip(true)
Tries to detect the public IP address (version 4).
$ip4
Tries to detect the public IP address (version 6).
$ip6
Loads data from an URI.
$load("https://www.e-go-mobile.com/site/assets/files/1965/batch_ego_life_website_weiss-1600x550px.jpg")
Handles data as string and trims from leading whitespaces.
$ltrim(' TM + MK ')
Handles data as string and converts to lower case characters.
$lower('tm + MK')
Handles geo locations and displays markers on a map.
$map("ik}tH{a|c@pg@gvO")
$map([50.782131, 6.047182], [50.775635, 6.132818])
$map({ lat: 50.782131, lng: 6.047182 }, { lat: 50.775635, lng: 6.132818 })
$map({ lat: 51.782131, lng: 7.047182 }, [51.775635, 7.132818], "ik}tH{a|c@pg@gvO")
Handles a value as Markdown string.
$md("# Header 1\\n\\nHello, TM!")
Hashes a value with MD5.
$md5("TM+MK")
Returns the current time with an optional timezone.
$now("Europe/Berlin")
Starts a HTTP PATCH request.
$PATCH("https://example.com/users/19790905")
Converts from and to polyline.
$polyline("_p~iF~ps|U_ulLnnqC_mqNvxq`@")
Starts a HTTP POST request.
$POST("https://example.com/users/19790905")
Starts a HTTP PUT request.
$PUT("https://example.com/users/19790905")
Generates a password.
$pwd(64)
Extended require() function, which also allows to access the modules of that extension.
$r("moment").utc()
Reads data from a file. Relative paths will be mapped to the directory of the currently opened editor or the .vscode-powertools
sub folder inside the user's home directory.
$read("myFile.txt")
Converts RGB color from or to hex.
$rgb(5, 9, 79)
Resolves a value.
$res( Promise.resolve("TM"), s => s.toLowerCase() )
Handles data as string and trims from ending whitespaces.
$rtrim(' TM + MK ')
Hashes a value with SHA-1.
$sha1("TM+MK")
Hashes a value with SHA-256.
$sha256("TM+MK")
Hashes a value with SHA-384.
$sha384("TM+MK")
Hashes a value with SHA-512.
$sha512("TM+MK")
Returns a value or object as string that is NOT (null)
and NOT (undefined)
.
$str(5979 + 23979)
Opens a value as text in a new editor tab.
$tab("TM+MK")
Handles data as string and trims from leading and ending whitespaces.
$trim(' TM + MK ')
Uglifies the code in the active editor and opens the result in a new one.
The following languages are supported:
- CoffeeScript
- CSS
- HTML
- JavaScript
- JSON
- LESS
- XML
$uglify
Unwraps a value from being a function.
$unwrap(() => 5979)
Handles data as string and converts to upper case characters.
$upper('tm + MK')
Returns the current time in UTC.
$utc
Alias for $guid
.
$uuid
Writes data to a file. Relative paths will be mapped to the directory of the currently opened editor or the .vscode-powertools
sub folder inside the user's home directory.
$write("myFile.txt", "Data to write. Can be a string, stream or buffer")
Handles a value as YAML string and returns it as object.
$yaml( $load("https://raw.githubusercontent.com/swagger-api/swagger-samples/master/java/inflector-dropwizard-guice/src/main/swagger/swagger.yaml") )
Name | Description | Example |
---|---|---|
_ |
lodash | _.isString(5979) |
$fs |
fs-extra | $fs.existsSync("/path/to/something") |
$h |
helpers | $h.normalizeString("TM+MK") |
$m |
Moment.js | $m() |
$o |
opn | $o("https://e-go-mobile.com") |
$vs |
Visual Studio Code API | $vs.commands.getCommands |
If you would like to define key bindings for quick access, you can use the following command:
Name | Description |
---|---|
ego.power-tools.codeExecution |
Opens the input box for executing JavaScript code. |
Generates TypeScript code from JSON/JavaScript, TOML, XML/XSL or YAML (this command is only available, if you have an active, opened JSON/JavaScript, TOML, XML/XSL or YAML editor).
Keep in mind: JavaScript code will be executed and NOT parsed as JSON documents!
Sends the file of the currently, active editor to a destination.
Currently supported are:
If you would like to define key bindings for quick access, you can use the following command:
Name | Description |
---|---|
ego.power-tools.sendTo |
Opens the list of sub commands for send the current file to a destination. |
Manages TCP proxies.
If you would like to define key bindings for quick access, you can use the following command:
Name | Description |
---|---|
ego.power-tools.tcpProxies |
Opens the list of sub commands for handling TCP proxies. |
licensed under GDFL 1.3 - © Next.e.GO Mobile SE