Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 1.87 KB

File metadata and controls

69 lines (48 loc) · 1.87 KB

Get started with something

Home / Get Started

Install

# Requires node.js and pnpm.
$ pnpm install jsr:@something/core
# Using npm. Just requires node.js.
$ npx jsr add @something/core

Or, download a build from releases.

Get some boilerplate running

I'm sure everyone knows this by now. But here it is anyway.

Create an index.html file

Follow the damn title. Here's some copy-paste if you want it:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <div class="app"></div>
        <script type="module" src="main.js"></script>
    </body>
</html>

Create a javascript file

Again. Follow the title. Call it whatever you want, I don't care.
Make sure to load it in to the html file in the body, but after all content.

If you are not using a bundler, which is a very bad idea in production, make sure to add type="module" to your script tag, as something is built on es modules.

If you don't know what on earth a bundler is, you should probably go check out esbuild.

Import and use something

import { $, _ } from '@aworldc/something'

$('.app').insert(_('h1').text('Hello, world!'))

The above is just an example, obviously. if you couldn't guess what the code above does, it inserts <h1>Hello, world!</h1> into the first element with a class of app.

Read the documentation

Yes, I know. You have to read the freaking friendly manual.
Wait, you wanted a link? Oh ok. Here.

Or continue with the tutorial, over the page.