ampersand-version
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -16,5 +16,7 @@ var fs = require('fs'); | ||
var codeString = ';' + [ | ||
'window.ampersand = window.ampersand || {};', | ||
'window.ampersand["' + name + '"] = window.ampersand["' + name + '"] || [];', | ||
'window.ampersand["' + name + '"].push("' + version + '");' | ||
'if (typeof window !== "undefined") {', | ||
' window.ampersand = window.ampersand || {};', | ||
' window.ampersand["' + name + '"] = window.ampersand["' + name + '"] || [];', | ||
' window.ampersand["' + name + '"].push("' + version + '");', | ||
'}' | ||
].join(''); | ||
@@ -21,0 +23,0 @@ |
{ | ||
"name": "ampersand-version", | ||
"description": "Transform for making it easy to include version numbers of used ampersand modules.", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Philip Roberts <phil@latentflip.com>", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/ampersandjs/ampersand-version/issues", |
@@ -1,13 +0,31 @@ | ||
# AmpersandVersion | ||
# ampersand-version | ||
* Add ampersand-version to `"dependencies"` in package.json. | ||
* Add ampersand-version to `"dependencies"` in package.json | ||
* Add browserify transform as per below: | ||
```json | ||
{ | ||
"name": "some-ampersand-module", | ||
"dependencies": { | ||
"ampersand-version": "^1.0.1" | ||
}, | ||
"browserify": { | ||
"transform": ["ampersand-version"] | ||
} | ||
} | ||
``` | ||
* Add `/*$AMPERSAND_VERSION*/` to the top of the module's main file. | ||
* Add this to the package.json | ||
```json | ||
{ | ||
"browserify": { | ||
"transform": ["ampersand-version"] | ||
} | ||
} | ||
``` | ||
## why? | ||
Now it will use a browserifiy transform to create if necessary and add it's version to the `window.ampersand` just for reporting purposes. | ||
Now you can open the console on any ampersand site and see what ampersand modules it's using: | ||
![ampersand-version-demo](https://i.cloudup.com/B8SuBDceTH-3000x3000.png) | ||
## license | ||
MIT |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2200
22
32
1