Create a `fastn` package

`fastn` is also a `ftd` package manager. A package contains all related and necessary files. `fastn` manages the packages and modules for `ftd` and consists of command line tool `fastn`. To get started, you need to install `fastn`. Refer to the [install `fastn`](install/) page to learn how to install `fastn`.

Create a package

There are two ways to create a fastn package:
Using Command (Recommended)
Manual

Using Command

The simplest way to create a `fastn` package is to use the command line tool. Suppose you want to create a package named `hello-fastn`, you need to follow these steps: - [Open the Terminal (Linux/MacOS) or Command prompt (Windows)](open-terminal/) - Run the following command in terminal
create-package
fastn create-package hello-fastn
Lang:
sh
The above command will create a folder named `hello-fastn` containing two files: [`FASTN.ftd`](create-fastn-package/#fastn-ftd) and [`index.ftd`](create-fastn-package/#index-ftd). You can view the contents of this folder in a text editor such as [SublimeText](https://www.sublimetext.com/3).

Serving the package

After creating the package as described above, you can start the HTTP server. Follow these steps: - [Open the Terminal (Linux/MacOS) or Command prompt (Windows)](open-terminal/) - Navigate to the package location in the terminal using the `cd ` command.
go to the package location
cd hello-fastn
Lang:
sh
- Once you are in the package location, run the following command to start the HTTP server:
serve
fastn serve
Lang:
sh
After starting the HTTP server, open any web browser and type "http://127.0.0.1:8000" into the URL bar. Voila! You can now view your "hello world" page in the browser.

`FASTN.ftd`

`FASTN.ftd` is a configuration file where we set configuration for the package. In `FASTN.ftd`, the code should look like this:
`FASTN.ftd`
-- import: fastn

-- fastn.package: hello-fastn
Lang:
ftd
In the code above, we set the package name as`hello-fastn`.

`index.ftd`

`index.ftd` is the index page of your package. You can think of the index page as being the home or default page of your package. In `index.ftd`, the code should look like this:
`index.ftd`
-- ftd.text: Hello World
Lang:
ftd
In the code above, we added a kernel component `ftd.text` and passed `Hello World` as the value for `text` property.

Support `fastn`!

Enjoying `fastn`? Please consider giving us a star ⭐️ on [GitHub](https://github.com/fastn-stack/fastn) to show your support!
[⭐️](https://github.com/fastn-stack/fastn)

Getting Help

Have a question or need help? Visit our [GitHub Q&A discussion](https://github.com/fastn-stack/fastn/discussions/categories/q-a) to get answers and subscribe to it to stay tuned. Join our [Discord](https://discord.gg/a7eBUeutWD) channel and share your thoughts, suggestion, question etc. Connect with our [community](/community/)!
[💻️](/community/)

Found an issue?

If you find some issue, please visit our [GitHub issues](https://github.com/fastn-stack/fastn/issues) to tell us about it.

Quick links:

- [Install `fastn`](install/) - [Create `fastn` package](create-fastn-package/) - [Expander Crash Course](expander/) - [Syntax Highlighting in Sublime Text](/sublime/)

Join us

We welcome you to join our [Discord](https://discord.gg/a7eBUeutWD) community today. We are trying to create the language for human beings and we do not believe it would be possible without your support. We would love to hear from you.
Copyright © 2023 - [FifthTry.com](https://www.fifthtry.com/)