issyntax

1.0.1 • Public • Published

issyntax

check if a item is a syntax in the javascript environment using issyntax using the isKeyword function. Checks for most inbuilt functions and lexical grammer keywords in javascript environment

Demos can be found in the folder demos

USAGE: isKeyword

const { isKeyword } = require("issyntax");

console.log("isKeyword('let');", isKeyword("let"));
console.log("isKeyword('const');", isKeyword("const"));
console.log("isKeyword('var');", isKeyword("var"));
console.log("isKeyword('function');", isKeyword("function"));
console.log("isKeyword('yield');", isKeyword("yield"));
console.log("isKeyword('Array');", isKeyword("Array"));
console.log("isKeyword('String');", isKeyword("String"));
console.log("isKeyword('Buffer');", isKeyword("Buffer"));
console.log("isKeyword('Arrays');", isKeyword("Arrays"));
console.log("isKeyword('Strings');", isKeyword("Strings"));
console.log("isKeyword('Buffers');", isKeyword("Buffers"));

USAGE: isInbuiltObjectOrFunction

const { isInbuiltObjectOrFunction } = require("issyntax");

console.log("isInbuiltObjectOrFunction(global, 'Arrays');", isInbuiltObjectOrFunction("Arrays"));
console.log("isInbuiltObjectOrFunction(globalThis, 'Strings');", isInbuiltObjectOrFunction("Strings"));
console.log("isInbuiltObjectOrFunction(window, 'Buffers');", isInbuiltObjectOrFunction("Buffers"));

REFERENCES

Package Sidebar

Install

npm i issyntax

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

36.8 kB

Total Files

10

Last publish

Collaborators

  • ganeshkbhat