How to use forked NativeScript plugin?


#1

I’d like to use a NativeScript plugin which I forked on Github: https://github.com/hosikiti/nativescript-ngx-iphonex-safe-area.

Because the plugin does not have ‘package.json’ in a root folder,

tns plugin add git+https://github.com/hosikiti/nativescript-ngx-iphonex-safe-area

finishes with following error:

npm not being able to find a package.json.

How can I install this forked plugin?
I’d really appreciate any help on this,


#2

Check the src the folder which usually recommended for adding plugin related files, package.json / npm modules, and plugin code etc.,


#3

@manojdcoder Thanks. In case package.json is in src folder, how can I install forked github repository with tns command?


#4

Compile the plugin using the scripts in publish folder (pack.sh), copy the compressed file to your project and point your package.json to that file.

If you think whatever change you did helps others too, let the plugin author know, raise a pull request :slight_smile:


#5

@manojdcoder Thank you!