1.1.5 • Published 2 years ago

abbreviatedjs v1.1.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Ab.JS

Make writing JS easier

lil tool i use internally

Install

npm install --save-dev abbreviatedjs

commands

npx abv --file [.ajs file]
# ^^ To compile a file ^^
npx abv --dir [dir]
# ^^ To compile all the .ajs files in [dir]

use --ts to use .ats files

abbreviations

In the form {abbreviation}, {commonjs equivatent}

  [`lg`, `console.log`],
  [`er`, `console.error`],
  [`wrn`, `console.warn`],
  [`cls`, `console.clear()`], // no parentheses needed, no args
  [`vv`, `var`],
  [`vl`, `let`],
  [`vc`, `const`],
  [`eq`, `==`],
  [`seq`, `===`],
  [`el`, `else`],
  [`pl`, `+=`],
  [`mn`, `-=`],
  [`fun`,`function`],
  [`as`, `async`],
  [`aw`, `await`],
  [`to_i`, `parseInt`],
  [`to_f`, `parseFloat`],
  [`err`, `new Error`],
  [`tt`, `true`],
  [`ff`, `false`],
  [`dte`, `new Date`],
  [`cth`, `catch`],
  [`jp`, `JSON.parse`],
  [`jst`, `JSON.stringify`],
  [`brk`, `break`],
  [`clss`, `class`],
  [`expt`, `export`],
  [`imp`, `import`],
  [`req`, `require`],
  [`ret`, `return`],
  [`swt`, `switch`],
  [`sta`, `static`],
  [`fori`, ` for (let i = 0;`],
  [`efori`, `; i++)`],
  [`dft`, ` default`]
]

suffixes

  [`.to_s`, `.toString()`],

example script

fun main() {
  fori i<100 efori {
    lg(i.to_s);
  }
  /* >> '1'
   * >> '2'
   * >>  ...
   * >> '99'
   */
}

This script is a main() function that iterates 100 times 0..99, and prints stringified versions to the console.

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.69

2 years ago

1.0.1

2 years ago