Skip to content

Developer manual: Start building an app using the app generator

Jan Smolders edited this page Apr 23, 2019 · 8 revisions

Start building an app/plugin using the plugin generator

Thanks to Terry Moore there is a handy plugin or app generator for MediacenterJS available at: https://github.com/TerryMooreII/mediacenterjs-plugin-generator

Generator script to stream line creation of MediacenterJS plugins.

##How to use:

Install the mediacenterjs-plugin-generator globally

npm install mediacenterjs-plugin-generator -g 

or on OSX/Linux/Windows

npx mediacenterjs-plugin-generator

Since the plugin generator is installed globally you can now navigate to an empty directory in you terminal window and run mediacenterjs-plugin-generator then answer a few questions.

mediacenterjs-plugin-generator
prompt: Plugin Name (Letters and Dashes only):  Awesome Plugin Name
prompt: Short description of the plugin.:  This plugin is going to do awesome things
prompt: Author:  Terry Moore
prompt: Keywords (comma seperated):  audio, podcast
prompt: Plugins GitHub repo homepage (optional):  http://github.com/TerryMooreII/mediacenterjs-awesome-plugin-name
Sit back and relex while we create your plug-in's skeleton...
Plug-in created successfully.
Go forth and create something cool!

Your plugin is now in the mediacenterjs-<your-plugin-name> directory.

Note: We will automatically append the mediacenterjs- to your plugin name. This is so that MediacenterJS's plugin manager will find your plugin once you have submitted it to the node NPM repository.

You can also read the mediacenterjs plugin INSTRUCTION.md file located in your new plugin home folder.

Building an App

There are thousands of useful node libraries you can use to build your app. Simply install the module you want with NPM and start using it. Just make sure to add any dependencies to your package.json.

Deploying your app

Once you are satisfied with your app, simply make sure your package.json is up to date and contains the proper info and dependencies. Then, open a terminal or command prompt in the directory of your app and type

 npm publish

NPM os the NodeJS package manager and will be used to publish your plugin. You'll probably need to enter your npm username and password. If you haven't got one yet, you can create one in your terminal or register at npmjs.org