From 3e427abef7b50ee0a1cb2d9211635c6d1e90d3a1 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Mon, 25 Mar 2024 15:57:03 +0100 Subject: [PATCH] restructed getting started guide --- docs/docs/intro.md | 62 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 36491a72..9bf857dc 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -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`): @@ -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: