Importing Grammar javascript file


I am creating a package, and in that package I need to extend the Grammar class ( What would I put in the require to successfully import that? Also, how would I import the modules like Oniguruma that atom has included

Syntax highlighting with javascript

Perhaps have a look at:
A confusion of grammars: Need help integrating one grammar within another


I just want to know how to import it (IE what to put in require). I can do const firstMate = require(path.dirname(path.dirname(require.resolve("atom"))) + "/node_modules/first-mate");, but that seems hacky