Bower (software)

from Wikipedia, the free encyclopedia
Bower
Basic data

developer Twitter and contributors to the GitHub community
Publishing year 2012
Current  version 1.8.8
( January 23, 2019 )
operating system Platform independent
programming language JavaScript ( Node.js )
category Package manager
License MIT license
German speaking No
bower.io

Bower is a free package manager for client-side web development . It makes it easy to install and update libraries and frameworks , using an in Node.js written command-line tool .

Functionality and concepts

Bower is controlled via the command line ( shell ). The following is a list of key Bower commands and concepts.

installation

Bower is a command line program and requires Node.js and is therefore installed with the Node Package Manager (npm) . For installation on Unix systems or POSIX systems, the command is executed npm install -g bowerin the shell to execute the installation globally.

After the installation, the command is now available in the command line bower.

Packages

At Bower, packages are individual programs such as B. jQuery and Angular.js , i.e. stand-alone software packages, libraries and frameworks .

Packages can be installed individually via the shell. To do this, navigate to the folder in the shell and execute bower install [package], " package " must be replaced by the appropriate package (to be installed).

There are various ways of specifying the package. "Registered" packages , that is, identified by a unique name at Bower (these are mostly larger / better-known software projects), this name can be specified on its own. B. looks like this bower install jquery. A GitHub abbreviation can also be Entwickler/Projektspecified in the form and looks like this for Angular.js bower install angular/angular.js. In addition, a unique address, you can specify either a Gitadresse ( bower install git://github.com/user/package.git) or HTTP - URL ( bower install http://example.com/script.js) can be specified.

Project initialization and bower.json

A folder can be bower init initialized with the command , when this command is executed a bower.json file is created. This can also be created independently. A bower.json looks like this:

{
  "name": "my-project",
  "version": "1.0.0",
  "main":  [
    "path/to/main.js",
    "path/to/main.css"
  ],
  "private": true,
  "keywords": [
    "MyKeyword",
    "OtherKeword"
  ],
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<name>": "<version>",
    "<name>": "<folder>",
    "<name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Contains the project name as a string . expects a string with the current version, usually in the format " Major.Minor.Patch " . optionally contains the path (s) of a maximum of one file per type (e.g. JavaScript , CSS , ...) as a string or array, which can be viewed as the entry point for using the project. is a Boolean , if set to it indicates that this project is not intended for publication. takes a string array with the files to be ignored for productive use as a value. are the dependencies to be specified as a hash that must be met in any case. are also to be defined as hash dependencies, but are only required for further development ( testing , documentation, etc.). "name""version""main""private"true"ignore""dependencies""devDependencies"

The and can also use the shell commands , which the specified " package " to the " dependencies " or this adds the specified " package " to the " devDependencies " in the bower.json added. "dependencies"devDependenciesbower install <package> --savebower install <package> --save-dev

If you bower installexecute the command in a folder in which a (completed) bower.json file is located, the " dependencies " and " devDependencies " are downloaded if necessary and are bower_components/stored in the folder by default . The installation of the " devDependencies " can be prevented by specifying bower install -p"p" for " production ".

history

Bower was initiated by Twitter as part of its open source initiative in 2012 and is currently being developed by a team of 7 core developers and 121 contributors from the GitHub community (as of late November 2014).

With the increasing spread of the ECMAScript -6- module system , many projects and developers have switched to NPM in combination with bundler software such as Browserify or Webpack . The project has been considering calling itself deprecated since June 2016 . Since May 2017, the project and website have recommended using Yarn and Webpack as replacements.

Surname

Bower was after the English name of the bird species of deciduous Birds (English Bowerbirds named). In this type of bird, the male collects various colored objects in order to make his arbor as splendid as possible, since females mate with the builder of the most splendid arbor. According to his own statements, Bower does exactly that: It collects the programs (objects) and makes them available to the developer in order to develop his application (arbor).

The logo shows a golden arboretum performing its courtship dance and was designed by Dave DeSandro and Isaac Durazo .

The logo development was documented on GitHub Gist .

Web links

Individual evidence

  1. a b About. In: bower.io. Retrieved November 29, 2014 .
  2. Release 1.8.8 . January 23, 2019 (accessed January 23, 2019).
  3. Install Bower. In: Bower. Retrieved November 29, 2014 .
  4. a b c Creating packages. In: Bower. Retrieved November 30, 2014 .
  5. ^ Contributors. In: GitHub . Retrieved November 29, 2014 .
  6. Bower Repository on GitHub. In: GitHub . Retrieved November 29, 2014 .
  7. ECMAScript 6: New Features: Overview and Comparison. In: es6-features.org. Retrieved December 29, 2016 (English, Modules: Value Export / Import. Support for exporting / importing values ​​from / to modules without global namespace pollution.).
  8. ^ Consider deprecating Bower. Issue # 2298 bower / bower. In: GitHub. Accessed December 29, 2016 .
  9. Add yarn and webpack recommendation (# 2458) bower / bower @ 0bd318d. May 19, 2017, accessed on March 17, 2018 (English): “..psst! While Bower is maintained, we recommend yarn and webpack for new front-end projects! "
  10. How to migrate away from Bower? In: bower.io/blog. October 2, 2017, accessed March 17, 2018 .
  11. The Bowerbird. In: bower.io. Retrieved November 29, 2014 .
  12. Bower logo. In: Bower. Retrieved November 29, 2014 .
  13. Dave DeSandro : Bower logo. In: gist.github.com. Retrieved November 29, 2014 .