alias-win

An effort to encapsulate aliases used by the console of current process.

Usage no npm install needed!

<script type="module">
  import aliasWin from 'https://cdn.skypack.dev/alias-win';
</script>

README

alias-win

NPM version AppVeyor Codecov David

An effort to encapsulate aliases used by the console of current process.

This library provides native bindings for Windows APIs:

Usage

const alias = require("alias-win");
alias.get().then(console.log);

API

alias.get([exeName])

Get console aliases for the specified executable.

console.log(await alias.get())

alias.getSync([exeName])

For detailed information, see the documentation of the asynchronous version of this API: alias.get().

alias.set(aliases, [exeName])

Set console aliases for the specified executable.

await alias.set({
  sudo: "$*",
  ll: "ls -l $*",

  // Use `null` to unset an alias
  bash: null,
});

alias.setSync(aliases, [exeName])

For detailed information, see the documentation of the asynchronous version of this API: alias.set().

CLI

The console aliases may be set and unset with the alias and unalias commands. For detailed information, see the documentation of bash

Related