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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.41latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.41
1.0.30
1.0.20
1.0.10
1.0.00

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