Bowinst is a command-line application to install Bower component references in your source files. Bowinst only works with Bower 1.3.0 or later.
<script>tags or css
<link>tags from your Bower components into your source files.
coffee, etc) or use the simple extension system to add more complex logic.
<script>tag after bowinst created the tag, further bowinst usage will not remove or alter that
npm install -g bowinst
You'll need to configure
bowinst before you can get started. Run
bowinst init in your project directory to configure it to use
bowinst. This configuration must be done in every project you wish to use
Here's an example of running
$ bowinst init Enter the HTML file where <script> and <link> tags should be added (index.html) app/index.html If this is an Angular project, enter the JS file where the main Angular module is created. If not, just hit Enter. (app.js) app/scripts/app.js >> .bowerrc created >> .bowinst.js created Good to go!
bowinst init does the following:
.bowerrcso Bower will trigger
bowinstafter each Bower install/uninstall.
.bowinst.jsto tell Bowinst where your main HTML file is and, if you're using Angular, where your Angular module setup code exists. If your answers are the same as the Bowinst's defaults (
.bowinst.jswon't be created.
Next you'll need to add the comment markers to your HTML file so Bowinst knows where to put your
<link> tags. For
<script> tags, use these surrounding comment markers:
<!-- bower-js:start --> <!-- bower-js:end -->
<link> tags, use these:
<!-- bower-css:start --> <!-- bower-css:end -->
That's it. Bowinst will now automatically install and uninstall
<link>, and Angular module references into your project automatically.
When installing a reusable Angular component, if it's
bower.json includes an
angularModule property then Bowinst will add that for you. For example, if you were installing an angular component named
reusableAngularComponent, it would change this:
Please help spread the word to Angular component authors. Let them know to add the
angularModule property to their
There are many more configuration options as well as the ability for anyone to create their own extensions. Please see the Advanced documentation for more details.