npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

assistscript

v1.4.2

Published

AssistScript is a custom command based language

Downloads

18

Readme

AssistScript

NPM License NPM Version

Table of Contents


Introduction📜

AssistScript is a simple scripting(?) language that I made for fun. Not very useful, but it's fun to play around with. Initially started as a joke, and as time passed it became a fun project to work on.

The language is a straightforward, all you have to do is to specify a command and its arguments. The basic syntax is:

<command> <arg1> <arg2> ... <argN>

eg:

add 10 20 40

Outputs 70

✨ Want to try out the language? Check out the AssistScript Runner


Installation📲

You can install AssistScript using npm.

npm install -g assistscript

This installs the AssistScript CLI globally on your system. If you don't want AssistScript to be installed globally, you can omit the -g flag or use npx to run AssistScript without installing it.


Demos▶️

Want to see what the language can do? Check out the demos🧪 directory for some examples.

These demos are simple programs that demonstrate the language's features. You can run them using the CLI.

Sample Program - Bubble Sort🔢

Here is bubble sort in AssistScript:

(array arr 4 5 2 4 5 6 7 1)

(for (set i 0) (lt (get i) (len arr)) (incr i) (
    (for (set j 0) (lt (get j) (sub (len arr) (get i) 1)) (incr j) (
        (if (gt
                (index arr (get j))
                (index arr (add (get j) 1))
        ) (
            (set temp (index arr (get j)))

            (set-arr arr (get j) (index arr (add (get j) 1)))
            (set-arr arr (add (get j) 1) (get temp))
        ))
    ))
))

(for (set i 0) (lt (get i) (len arr)) (incr i) (
    (print (index arr (get i)))
))

Output:

1
2
4
4
5
5
6
7

Visit the online AssistScript runner to run assistscript programs online.


Usage✍

AssistScript can be used in multiple ways. You can use it as a standalone program in the terminal using the AssistScript CLI, or you can use it inside your JavaScript code.

Using terminal💻

You can run AssistScript using the terminal. The AssistScript package comes with a command-line interface to run AssistScript files. It also has a REPL mode to run commands interactively.

# Without installing the package
npx assistscript

OR

# Once the package is installed
aslangc

The above commands, once executed, will show the help menu for the CLI.

📝 You can interchangeably use aslangc and assistscript in the terminal.

REPL mode⌨️

You can run the REPL mode by using the -r or --repl flag.

aslangc -r

File Mode📂

You can run AssistScript(.asrc) files using the CLI by providing the path to the file.

aslangc <path-to-file>

Using the API💻

You can also use AssistScript in your JavaScript code, for this AssistScript exposes a simple API. The AssistScript class is the main class that you can use run AssistScript code.

import {AssistScript} from 'assistscript';

const as = new AssistScript();

// Prints 70
console.log(as.run('add 10 20 30'));
// Prints 50 <- (100 - 20 - (10 + 20))
console.log(as.run('sub 100 20 (add 10 20)'));

Want to learn more?🏫

Check out the documentation📃 for more information on the language and its features.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Made with 💙 by fbn776