# jspm-bower-endpoint

> Bower endpoint for JSPM

Latest version **0.3.2** (published 2015-03-31) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install jspm-bower-endpoint
pnpm add jspm-bower-endpoint
yarn add jspm-bower-endpoint
bun add jspm-bower-endpoint
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2015-03-31 |
| First published | 2015-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+4 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Fede Ramirez |
| Maintainers | 2fd |
| Keywords | jspm, bower, endpoint, plugin |

## Links

- npm: https://www.npmjs.com/package/jspm-bower-endpoint
- Repository: https://github.com/2fd/jspm-bower-endpoint
- Issues: https://github.com/2fd/jspm-bower-endpoint/issues
- npm.io page: https://npm.io/package/jspm-bower-endpoint

## Dependencies (6)

- [q](https://npm.io/package/q.md) ^1.2.0
- [mout](https://npm.io/package/mout.md) ^0.11.0
- [bower](https://npm.io/package/bower.md) 1.4.0
- [semver](https://npm.io/package/semver.md) ^4.3.0
- [bower-logger](https://npm.io/package/bower-logger.md) 0.2.2
- [bower-endpoint-parser](https://npm.io/package/bower-endpoint-parser.md) 0.2.2

## Recent versions

- 0.3.2 (latest) — 2015-03-31
- 0.3.1 — 2015-03-30
- 0.3.0 — 2015-03-18
- 0.2.0 — 2015-03-03
- 0.1.0 — 2015-02-24
- 0.1.0-RC1 — 2015-02-23
- 0.0.3-dev — 2015-02-11
- 0.0.1-dev — 2015-02-11

## README

# JSPM Bower Endpoint
[![License](https://img.shields.io/npm/l/jspm-bower-endpoint.svg?style=flat-square)](https://github.com/2fd/jspm-bower-endpoint/blob/master/LICENSE)
[![Build Status](https://img.shields.io/travis/2fd/jspm-bower-endpoint.svg?style=flat-square)](https://travis-ci.org/2fd/jspm-bower-endpoint)
[![NPM](https://img.shields.io/npm/v/jspm-bower-endpoint.svg?style=flat-square)](https://www.npmjs.com/package/jspm-bower-endpoint)


Bower command-line adapter from jspm

## Install
```bash
    
    npm install -g jspm-bower-endpoint
   
    # add registry endpoint
    jspm registry create bower jspm-bower-endpoint

    # jspm < 0.15.0
    # jspm endpoint create bower jspm-bower-endpoint
    
```

## Use

```bash

	# install bower package    
    jspm install bower:skeleton

    #install git+bower package
    # jspm-bower-endpoint >= v0.3.0
    jspm install name=bower:http//github.com/user/package.git
    jspm install name=bower:https://github.com/user/package.git
    jspm install name=bower:git@github.com:user/package.git
    
    #install local file
    # jspm-bower-endpoint >= v0.2.0
    jspm install name=bower:./file.js
    jspm install name=bower:~/path/to/path/to/file.js
    jspm install name=bower:/absolute/path/to/file.js
    # jspm-bower-endpoint >= v0.3.0
    jspm install name=bower:file://absolute/path/to/file.js
    
    # install local folder package
    # jspm-bower-endpoint >= v0.2.0
    jspm install name=bower:./local/folder
    jspm install name=bower:~/path/to/local/folder
    jspm install name=bower:/absolute/path/to/local/folder
    # jspm-bower-endpoint >= v0.3.0
    jspm install name=bower:file://absolute/path/to/local/folder
    
```

## Features

### Automatic main resolve from bower

Find and use the js file

```javascript
    
    // bower.json
    {
        "main" : [
            "less/bootstrap.less",
            "dist/css/bootstrap.css",
            "dist/js/bootstrap.js",
            "dist/fonts/glyphicons-halflings-regular.eot",
            "dist/fonts/glyphicons-halflings-regular.svg",
            "dist/fonts/glyphicons-halflings-regular.ttf",
            "dist/fonts/glyphicons-halflings-regular.woff",
            "dist/fonts/glyphicons-halflings-regular.woff2"
        ]
    }
    
    //resolve
    {
        "main" : "dist/js/bootstrap.js"
    }
    
```

if main property not include js files but include a single css file, automatically added plugin dependency and include it
> jspm-bower-endpoint >= 0.3.0

```javascript
    
    // bower.json
    {
        "main": "./css/font-awesome.css"
    }
    
    //resolve
    {
        "main" : "./css/font-awesome.css!css",
        "dependencies": {
            "css": "jspm:css@*"
        }
    }  
    
```

Use `main:false` if cannot solve in a single file or main does not include a js|css file

```javascript
    
    // bower.json
    {
       "main" : [
           "dist/js/bootstrap.js",
           "dist/js/bootstrap.min.js"
       ]
    }
    
    //resolve
    {
        "main" : false
    }  
    
```


### Automatic css dependencies

If main includes css files, the css-plugin is added to the dependencies

```javascript
    
    // bower.json
    {
        "main" : [
            "less/bootstrap.less",
            "dist/css/bootstrap.css",
            "dist/js/bootstrap.js",
            "dist/fonts/glyphicons-halflings-regular.eot",
            "dist/fonts/glyphicons-halflings-regular.svg",
            "dist/fonts/glyphicons-halflings-regular.ttf",
            "dist/fonts/glyphicons-halflings-regular.woff",
            "dist/fonts/glyphicons-halflings-regular.woff2"
        ],
        "dependencies": {
            "jquery": ">= 1.9.1"
        }
    }
    
    //resolve
    {
        "main" : "dist/js/bootstrap.js",
        "dependencies": {
            "jquery": "jquery@>=1.9.1",
            "css": "jspm:css@*"
        }
    }
    
```

In the case of the package without js files is necessary install the css-plugin directly in project through run `jspm install css`
```javascript
    
    // bower.json
    {
        "main": "css/skeleton.css",
        "dependencies": {}
    }
    
    //resolve
    {
        "main" : false,
        "dependencies": {
            "css": "jspm:css@*"
        }
    }  
    
```

### Format property dynamically defined
> jspm-bower-endpoint >= 0.2.0

If moduleType property is defined in bower package,
the format property can be defined properly

```javascript
    
    // bower.json
    {
        "moduleType": [
            "amd",
            "globals",
            "node"
        ]
    }
    
    //resolve
    {
        "format" : "cjs"
    }  

```

By default, global format is used.
if you need use other format, use the override flag

```bash
    
    ## Use jquery in amd mode
    jspm install bower:jquery -o "{ format:'amd', main:'src/jquery.js'}"
    jspm install name=bower:~/local/package -o "{ format:'es6'}"
    
```

---
_Source: https://npm.io/package/jspm-bower-endpoint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
