cli-nova
v1.3.3
Published
<p align="center"> <img width="300" src="https://github.com/dan-online/Nova/raw/master/build/round.png"> <h1 align="center">Welcome to Nova π (Beta)</h1> <p align="center"> <a href=""> <img alt="Nova NPM downloads" src="https://img.shields.io/npm/dt/
Downloads
45
Maintainers
Readme
Table of Contents
About
Nova is an opensource programming language built on node. The purpose of Nova is to make a pure psuedo-code language that is the perfect introduction into computer science. Completely built on node v12 and connected to npm packages, Nova is optimized for running on mac, linux and windows!
I made this project to make a pseudocode based language that simplified computer science. Nova's main purpose is to make it easier for non-programmers to learn the basics of coding. Using words such as "set" and "as" and "equals" makes it easier to follow and understand what is happening.
To get started go to usage and start your Nova journey today.
To support me, DanCodes, you can donate to my Patreon or just give this project a star :)
Usage
Install
npm i -g cli-nova
Run
nova [options] [file]
Example runs
nova test.ns
nova --verbose test.ns
Examples
// We recommend setting swift for language highlighting
set variable as "hello"; // "Strings"
output.log(variable); // Logging
set two as 1 + 1; // Numbers
set array as [1,2,3,4,5];
set chalk as include("chalk"); // Npm integration
output.log(chalk.red("Red text")); // Logs red
output.log(12 / 2 % 2 + 1); // Logs 3
if two equals 2 then output.log("two is equal to 2");
if two isnot 2 then output.log("won't be logged") else output.log("two is not not equal to 2");
Keywords
Documentation
Variables
For variables we use two keywords, "set" and "as". All variable values are evaluated on initiation and stored in memory. They can be referenced at any time throughout the code and are global.
set hello as "world1";
output.log("hello " + hello.slice(0, -1)); // output: hello world
Variables can also be set to npm modules and other files. Modules can be installed using npm.
set chalk as include("chalk");
set path as include("path");
set redText as chalk.red("red text");
output.log(redText);
set package as include(path.resolve("./package.json"));
output.log("Running v" + package.version);
Global Variables
Args
Description: Args is defined as arguments passed in the command line when starting nova.
Type: Array
Example:
// test.ns
output.log(args);
// Command line
$ nova test.ns --test
['--test']
Platform
Description: The platform the program is being run on, for example: linux, darwin and win32
Type: String
Example:
// test.ns
output.log(platform);
// Command line on macbook
$ nova test.ns
darwin
Process
Description: The process running containing information and functions to manipulate
Type: Object
Examples:
// test.ns
set exitCode as 0;
output.log("Process id is " + process.pid);
process.exit(exitCode);
// Command line
$ nova test.ns
Process id is 12345
Nova
Description: File information and Nova information
Type: Object
Examples:
// test.ns
output.log(Nova);
// Command line
$ nova test.ns
{
directory: '/files',
node: 'vX',
version: 'vX',
}
Tickers
Description: Intervals and timers that allow you to run something every certain time or after a certain time
Type: Function
Examples:
// test.ns
set timer as startTimer(() => { output.log("After one second, I have logged") }, 1000);
set interval as startInterval(() => { output.log("I log every 5 seconds") }, 5000);
startTimer(() => { stopTimer(timer); stopInterval(interval); }, 11000);
// Command line
$ nova test.ns
After one second, I have logged
I log every 5 seconds
I log every 5 seconds
Include
Description: Include is an alias of node require and allows users to import npm modules and seperate files.
Type: Object
Examples:
// test.ns
set chalk as include("chalk");
output.log(chalk.red("I am red text :)"));
// Command line
$ nova test.ns
I am red text :)
Output
Description: Output is an alias of node console and lets you output to the console
Type: Object
Examples:
// test.ns
output.clear(); // This clears the output
output.log("This is regular log");
output.error("This is an error");
output.info("This is some info");
// Command line
This is regular log
This is an error
This is some info
Author
π€ DanCodes [email protected]
- Website: https://dancodes.online
- Github: @dan-online
π€ Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page.
Show your support
Give a βοΈ if this project helped you!
π License
Copyright Β© 2020 DanCodes [email protected]. This project is MIT licensed.
This README was generated with β€οΈ by readme-md-generator