1
0
Fork 0

wip(shared): Started working on jargon overhaul

See #6017
This commit is contained in:
joostdecock 2024-02-17 19:55:56 +01:00
parent 43c069719c
commit e87e889a87
12 changed files with 331 additions and 20 deletions

View file

@ -0,0 +1,18 @@
---
title: cjs
---
**cjs** stands for **CommonJS**. It is a module system for JavaScript that was
popularized by NodeJS, and as such typically used in server-side JavaScript.
CommonJS uses the **require** keyword to import modules:
```js
const fs = require('fs')
```
In recent years, **cjs** is increasingly being replaced by **esm**, or ECMA
Script Modules which is the official module system of the JavaScript language,
and the future-proof choice.
Since version 3, FreeSewing is ESM-only.

View file

@ -0,0 +1,7 @@
---
title: Terminology
---
These are terms that we use on this website that may or may not be new to you:
<ReadMore />

View file

@ -0,0 +1,17 @@
---
title: esm
---
**esm** stands for **ECMAScript Modules** and is the official module system of
the JavaScript language, supported both in the browser, and on the server.
While ESM is the official standard, before it existed people would typically use CJS outside the browser, as it was popularized by NodeJS.
Some libraries still are not available in ESM, but FreeSewing has been ESM-only since version 3.
ESM uses the **import** keyword to import modules:
```js
import fs from 'fs'
```

View file

@ -0,0 +1,14 @@
---
title: Variadic
---
A **variadic** function is a function that accepts a variable number of arguments.
For example, JavaScript's `console.log` method is variadic:
```js
console.log('one')
console.log('one', 'two')
console.log('one', 'two', 'three')
console.log('It', 'word', 'regardless', 'of', 'how', 'many', 'arguments', 'you', 'pass')
```