WebStorm Bower Fundamentals Flashcards
What is Bower
A package installer.
From where does Bower download its packages?
GitHub.com (or another git endpoint)
What is the command for installing bower globally?
npm install bower -g
What technologies do we need installed on our system to install bower?
Node.j’s
MSysGit/Git for Windows
Which files can we add to control configuration of bower in our local project?
bower.json
.bowerrc
What configuration options are available for bower from within the .bowerrc file?
directory - the directory where packages will be added.
What is the command for installing a bower package
bower install [package-name]
How do we install a specific version of a package
bower install [package-name]#[version]
How do we get information about what versions of a package are available
bower info [package-name]
How can we make sure that all packages are up to date
bower update
How do we update just one packages
bower install [package-name]
How can we check which packages are installed?
bower list
How can we check what packages are available
bower search [search-term]
What is the bower homepage?
http://bower.io
What is the bower search page?
http://bower.io/search
What is the purpose of the bower.json file?
- Helps to keep track of the packages that have been installed into your project.
- When you are going to publish your own library that can be installed by others.
Which bower.json property tells us the package name?
“name”
Which bower.json property tells us the package version?
“version”
Which bower.json property tells us the file that is the main entry point for the package
“main”
Which bower.json property tells us about licence information?
“license”
How do we tell bower which files to ignore when the package is installed?
The “ignore” property in the bower.json file (a string array).
Which properties are available to us in the bower.json file?
name (string), version (string), main (string or array of string), license (string), ignore (array of string), devDependencies (object containing properties that have a key of the package name and a value of the version of that package), keywords (array of string), dependencies (as devDependencies), homepage (string), moduleType (string)
What is the command for creating a bower.json file?
bower init
If bower is used, do we need to check in packages?
No!
What is the command for installing dependent packages that are defined in the bower.json file?
bower install
How do we ensure that the bower.json file is updated when we install a new package?
bower install [package-name] –save
How do we ensure that the bower.json file is updated with dev dependencies when a new package is saved
bower install [package-name] –save-dev
How do we ensure that a package dependency in bower.json is updated when we uninstall it?
bower uninstall [package-name] –save
What is Bower Cache
A mechanism by which bower can locally cache packages that have already been downloaded so that it does not need to re-download them.
How can we see what is in the bower cache
bower cache list
How can we remove all items from the cache
bower cache clean
How can we prevent bower from reaching out to the online registry when installing a package
bower install [package-name] -o
If the package is cached, what effect does the -o flag have when installing a package?`
It prevents it from checking the version against the remote repository
How can we force bower to install the files from a local git repo?
bower install [directory-name]
How do we uninstall the files that have been added from a local repo?
bower uninstall [directory-name]
How do we install a single file from a specific url?
bower install [url]
How do we install only the dependencies (not the devDependencies) from bower.json?
bower install [package-name] –production
How can we install a package into a specifically named directory (i.e. overriding the default name)?
bower install [directory-name]=[package-name]
How do we get help for bower
bower help
How do we get help for a specific command in bower
bower help [command-name]
How do we get the git location for a specific package?
bower lookup [package-name]
How do we uninstall any packages that are not listed in bower.json as a dependency and which are also not a dependency of a dependent package?
bower prune
How do we reduce the output when installing a package
bower install [package-name] -q
How do we pipe output from an install to a json file?
bower install [package-name] -j > [file-name.json]
What is the verbose option for output
-V
What is the silent option for output
-s
After pushing to GitHub how do we register our package with bower?
bower register [package-name] [url-to-git-repo]