Git Product home page Git Product logo

nova's Introduction

Welcome to Nova ๐Ÿ‘‹ (Beta)

Nova NPM downloads Nova Languages Nova Code Size Nova License: MIT Nova Version Nova Codacy

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

To use nova you can either evaluate with the "-e/--eval" option in the command line or make a novascript. A novascript is a file ending in .ns and is made for nova. These files can be ran by the nova-cli.

Install

$ npm i -g cli-nova

Run

$ nova [options] [file]

Example runs

$ nova test.ns
$ nova --verbose test.ns
$ nova -e "output.log('HI!');"

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");

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]

๐Ÿค 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


nova's People

Contributors

dan-online avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nova's Issues

Welcome to ChangeMD

๐Ÿ˜Ž Beep boop, let's config!

ChangeMD is a bot made to help you keep your Changelog up to date!

If you are ready to configure NovaNode just comment changemd start

Or if you would like to ignore this repo just say changemd ignore


:octocat: Share | ๐Ÿ˜Ž Creator | ๐Ÿ’ธ Support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.