- string string
verify if the string contains a string
- string string
verify if the string is contains only one letter
verify if it contains a number
- number number
verify if it contains a decimal number with a number after the comma
- number number
verify if it contains a decimal number
- number number
verify if it contains a decimal number
get Position of the line in the code
get Position of the key in the line
- string string
get text in the string
- string string
verify if the string is contains only one letter
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);
}
});
npm i langscript