langscript

1.0.4 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i langscript

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

28.6 kB

Total Files

17

Last publish

Collaborators

  • xevaltan