twbs/bootstrap — pull request #13824 by jsdf (2014-06-15 06:05:32+00:00)
Title: Allow npm package to be resolved via node module resolution

Bootstrap currently publishes [an npm package](https://www.npmjs.org/package/bootstrap) but as there is no `index.js` or `main` field in the `package.json`, even if it is installed via npm it can't be resolved by `require.resolve()`.

This would be useful when using Bootstrap in projects with a node-based build system (grunt, gulp, etc). For example, something like:

```js
var path = require('path')

// using require.resolve
var bootstrapPath = path.dirname(require.resolve('bootstrap'))
// alternatively, just using require, as index.js exports __dirname
var bootstrapPath = require('bootstrap')

// compile some less with bootstrap in the import paths
require('less').render(someLessData, {paths: [bootstrapPath + '/less']} , function(err, data) {
...
})

```