1.0.4 • Published 4 years ago

langscript v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

LangScript

LangScript is a NodeJS Plugin for making Programming Languages thanks to pre-created functions

Summary

Functions

isString() :

parameters :

verify if the string contains a string

isChar() :

parameters :

verify if the string is contains only one letter

isNumber

parameters :

verify if it contains a number

isDouble

parameters :

verify if it contains a decimal number with a number after the comma

isFloat

parameters :

verify if it contains a decimal number

isFloat

parameters :

verify if it contains a decimal number

getLinePos

parameters :

get Position of the line in the code

getKeyPos

parameters :

get Position of the key in the line

getTextInString() :

parameters :

get text in the string

isChar() :

parameters :

verify if the string is contains only one letter

Examples

const langscript = require("langscript");

let code = 'print "hello"';

langscript.getKeyPos("print", code).then((k) => {
  let words = langscript.splitToWords(code);
  let nextKey = words[k.position + 1];

  if (langscript.isString(nextKey)) {
    let text = langscript.getTextInString(nextKey);
    console.log(text);
  } else if (langscript.isNumber(nextKey)) {
    console.log(nextKey);
  }
});

Installation

npm i langscript
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago