Include standard "old style" javascript


i am planning to use NativeScript to implement an old project made with cordova + ionic 1.0

The problem is i don’t know how to import standard javascript libraries (classic import with )

Not all libraries i previously used (and made) are in form of npm package. Is there a way to make a “standard” library javascript inclusion?



You may copy any JavaScript files / modules (that is not browser dependent) to your app folder, use it as a library with just a require statement.


hi manojdcoder,
you mean to import like
import * as from ‘library.path.js’ ?

I believed this could be done only for npm packaged libraries only

By the way thanks for reply


NPM has nothing to do with that, it’s just ES6 import statement applicable for any common js modules. One thing besides, usually you don’t include .js in path.