Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wiredep

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wiredep - npm Package Compare versions

Comparing version 1.4.4 to 1.5.0

6

lib/inject-dependencies.js

@@ -67,3 +67,7 @@ /*

forEach(function (filePath) {
newFileContents += spacing + fileType.replace[blockType].replace('{{filePath}}', filePath);
if (typeof fileType.replace[blockType] === 'function') {
newFileContents += spacing + fileType.replace[blockType](filePath);
} else if (typeof fileType.replace[blockType] === 'string') {
newFileContents += spacing + fileType.replace[blockType].replace('{{filePath}}', filePath);
}
});

@@ -70,0 +74,0 @@

2

package.json
{
"name": "wiredep",
"main": "./wiredep.js",
"version": "1.4.4",
"version": "1.5.0",
"description": "Wire Bower dependencies to your source code.",

@@ -6,0 +6,0 @@ "repository": "taptapship/wiredep",

@@ -6,5 +6,61 @@ # wiredep

## Getting Started
Install the module with: `npm install --save wiredep`
Install the module with [npm](https://npmjs.org):
```bash
$ npm install --save wiredep
```
Install your [bower](http://bower.io) dependencies (if you haven't already):
```bash
$ bower install --save jquery
```
Insert placeholders in your code where your dependencies will be injected:
```html
<html>
<head>
<!-- bower:css -->
<!-- endbower -->
</head>
<body>
<!-- bower:js -->
<!-- endbower -->
</body>
</html>
```
Let `wiredep` work its magic:
```bash
$ node
> require('wiredep')({ src: 'index.html' });
index.html modified.
{ packages:
{ jquery:
{ main: [Object],
type: [Object],
name: 'jquery',
dependencies: {} } },
js: [ 'bower_components/jquery/dist/jquery.js' ] }
```
```html
<html>
<head>
<!-- bower:css -->
<!-- endbower -->
</head>
<body>
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<!-- endbower -->
</body>
</html>
```
## Build Chain Integration

@@ -93,3 +149,6 @@

replace: {
typeOfBowerFile: '<format for this {{filePath}} to be injected>'
typeOfBowerFile: '<format for this {{filePath}} to be injected>',
anotherTypeOfBowerFile: function (filePath) {
return '<script class="random-' + Math.random() + '" src="' + filePath + '"></script>';
}
}

@@ -123,2 +182,14 @@ },

less: {
block: /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi,
detect: {
css: /@import\s['"](.+)['"]/gi,
less: /@import\s['"](.+)['"]/gi
},
replace: {
css: '@import "{{filePath}}";',
less: '@import "{{filePath}}";'
}
},
sass: {

@@ -125,0 +196,0 @@ block: /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc