Socket
Book a DemoInstallSign in
Socket

node-basic-lang

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-basic-lang

BASIC interpreter

latest
Source
npmnpm
Version
0.0.10
Version published
Maintainers
1
Created
Source

npm Node.js CI

BASIC

BASIC interpreter

Installation

  • You need to have at least versionv14.0.0 of node.js installed.

  • Install the node-basic-lang library globally:

npm install -g node-basic-lang

Executing files

  • Create a BASIC program using the supported commands below. Make sure that the file ends in .bas.

  • Run the BASIC program that you created

basic <program name>.bas

Example:

basic game.bas

Using the REPL

You can use the REPL just by running the following command in the terminal:

basic

Make sure that you enter a unique line number for each command, just like you would a normal file. See supported commands below for a list of commands you can use.

Supported commands

ABS - Prints out the absolute value of a number.
CLS - Clears the console.
INT - Prints out an integer by rounding any decimal number down.
PRINT - Prints lines to the console.
REM - Comments for the user. The interpreter ignores these lines.
END - Exits the program.

Sample file

10 CLS
20 REM "BASIC HELLO WORLD PROGRAM"
30 PRINT "HELLO WORLD"
40 PRINT "HELLO WORLD 2X"
50 PRINT "HELLO WORLD 3X"
60 ABS "-3.14"
70 INT "1.6180"
80 END

Keywords

BASIC

FAQs

Package last updated on 06 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.