Skip to content

Commit

Permalink
restructed getting started guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 25, 2024
1 parent ea2d346 commit 3e427ab
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,37 +106,6 @@ lips --bootstrap none foo.scm
This will run the code without loading the standard library. So LIPS will have only functions
and macros defined in JavaScript. This is called Core of LIPS with most of the essentials.
### Node.js project
Afeter you have installed LIPS you can create a new Node.js project and write LIPS Scheme code
instead of JavaScript, using everything Node.js provide See documentation about [Integration with
JavaScript](/docs/lips/intro#integration-with-javascript).
```bash
mkdir my-project
cd my-project
npm init -y
```
Then you can install npm packages
```bash
npm install braces # example npm package
```
and use them in LIPS Scheme:
```scheme
(define braces (require "braces"))
(write (braces "{01..10}" &(:expand #t)))
;; ==> #("01" "02" "03" "04" "05" "06" "07" "08" "09" "10")
```
**NOTE**: [braces](https://www.npmjs.com/package/braces) is a popular package to expand bash like
expressions, it's used as [deep dependeny for
TailwindCSS](https://shubhamjain.co/2024/02/29/why-is-number-package-have-59m-downloads/).
### Executing expressions
You can execute expression with `-e` flag (short of `eval`):
Expand Down Expand Up @@ -176,6 +145,37 @@ You can change that if you add dot (current working directory) to the `$PATH` en
export $PATH=".:$PATH"
```
### Node.js project
Afeter you have installed LIPS you can create a new Node.js project and write LIPS Scheme code
instead of JavaScript, using everything Node.js provide See documentation about [Integration with
JavaScript](/docs/lips/intro#integration-with-javascript).
```bash
mkdir my-project
cd my-project
npm init -y
```
Then you can install npm packages
```bash
npm install braces # example npm package
```
and use them in LIPS Scheme:
```scheme
(define braces (require "braces"))
(write (braces "{01..10}" &(:expand #t)))
;; ==> #("01" "02" "03" "04" "05" "06" "07" "08" "09" "10")
```
**NOTE**: [braces](https://www.npmjs.com/package/braces) is a popular package to expand bash like
expressions, it's used as [deep dependeny for
TailwindCSS](https://shubhamjain.co/2024/02/29/why-is-number-package-have-59m-downloads/).
## Executing LIPS prammatically
You can also execute LIPS from JavaScript:
Expand Down

0 comments on commit 3e427ab

Please sign in to comment.