Gathering detailed insights and metrics for broccoli-replace
Gathering detailed insights and metrics for broccoli-replace
Gathering detailed insights and metrics for broccoli-replace
Gathering detailed insights and metrics for broccoli-replace
npm install broccoli-replace
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
16 Stars
60 Commits
8 Forks
4 Watching
2 Branches
4 Contributors
Updated on 04 May 2021
Minified
Minified + Gzipped
JavaScript (90.76%)
Shell (9.24%)
Cumulative downloads
Total Downloads
Last day
-11.9%
1,294
Compared to previous day
Last week
10.8%
7,644
Compared to previous week
Last month
-1.4%
34,086
Compared to previous month
Last year
-23.3%
499,553
Compared to previous year
3
Replace text patterns with applause.
From NPM:
1npm install broccoli-replace --save-dev
Assuming installation via NPM, you can use broccoli-replace
in your Brocfile.js like this:
1var BroccoliReplace = require('broccoli-replace'); 2 3module.exports = new BroccoliReplace('src', { 4 files: [ 5 '**/*.html' 6 ], 7 patterns: [ 8 { 9 match: 'foo', 10 replacement: 'bar' 11 } 12 ] 13});
Supports all the applause options.
File src/manifest.appcache
:
CACHE MANIFEST
# @@timestamp
CACHE:
favicon.ico
index.html
NETWORK:
*
Brocfile.js:
1var BroccoliReplace = require('broccoli-replace'); 2 3module.exports = new BroccoliReplace('src', { 4 files: [ 5 'manifest.appcache' 6 ], 7 patterns: [ 8 { 9 match: 'timestamp', 10 replacement: Date.now() 11 } 12 ] 13});
File src/manifest.appcache
:
CACHE MANIFEST
# @@timestamp
CACHE:
favicon.ico
index.html
NETWORK:
*
File src/humans.txt
:
__ _
_ _/__ /./|,//_`
/_//_// /_|/// //_, outaTiME v.@@version
/* TEAM */
Web Developer / Graphic Designer: Ariel Oscar Falduto
Site: https://www.outa.im
Twitter: @outa7iME
Contact: afalduto at gmail dot com
From: Buenos Aires, Argentina
/* SITE */
Last update: @@timestamp
Standards: HTML5, CSS3, robotstxt.org, humanstxt.org
Components: H5BP, Modernizr, jQuery, Bootstrap, LESS, Jade, Grunt
Software: Sublime Text, Photoshop, LiveReload
Brocfile.js:
1var BroccoliReplace = require('broccoli-replace'); 2var pkg = require('./package.json'); 3 4module.exports = new BroccoliReplace('src', { 5 files: [ 6 'manifest.appcache', 7 'humans.txt' 8 ], 9 patterns: [ 10 { 11 match: 'version', 12 replacement: pkg.version 13 }, 14 { 15 match: 'timestamp', 16 replacement: Date.now() 17 } 18 ] 19});
File src/index.html
:
1<head> 2 <link rel="stylesheet" href="/css/style.css?rel=@@timestamp"> 3 <script src="/js/app.js?rel=@@timestamp"></script> 4</head>
Brocfile.js:
1var BroccoliReplace = require('broccoli-replace'); 2 3module.exports = new BroccoliReplace('src', { 4 files: [ 5 'index.html' 6 ], 7 patterns: [ 8 { 9 match: 'timestamp', 10 replacement: Date.now() 11 } 12 ] 13});
File src/index.html
:
1<body> 2 @@include 3</body>
Brocfile.js:
1var BroccoliReplace = require('broccoli-replace'); 2var fs = require('fs'); 3 4module.exports = new BroccoliReplace('src', { 5 files: [ 6 'index.html' 7 ], 8 patterns: [ 9 { 10 match: 'include', 11 replacement: fs.readFileSync('./includes/content.html', 'utf8') 12 } 13 ] 14});
File src/username.txt
:
John Smith
Brocfile.js:
1var BroccoliReplace = require('broccoli-replace'); 2 3module.exports = new BroccoliReplace('src', { 4 files: [ 5 'username.txt' 6 ], 7 patterns: [ 8 { 9 match: /(\w+)\s(\w+)/, 10 replacement: '$2, $1' // Replaces "John Smith" with "Smith, John" 11 } 12 ] 13});
foo
instead of @@foo
Brocfile.js:
1var BroccoliMergeTrees = require('broccoli-merge-trees'); 2var BroccoliReplace = require('broccoli-replace'); 3 4var inputNodes = [ 5 new BroccoliReplace('src', { 6 files: [ 7 'foo.txt' 8 ], 9 patterns: [ 10 { 11 match: /foo/g, // Explicitly using a regexp 12 replacement: 'bar' 13 } 14 ] 15 }), 16 new BroccoliReplace('src', { 17 files: [ 18 'foo.txt' 19 ], 20 patterns: [ 21 { 22 match: 'foo', 23 replacement: 'bar' 24 } 25 ], 26 usePrefix: false // Using the option provided 27 }), 28 new BroccoliReplace('src', { 29 files: [ 30 'foo.txt' 31 ], 32 patterns: [ 33 { 34 match: 'foo', 35 replacement: 'bar' 36 } 37 ], 38 prefix: '' // Removing the prefix manually 39 }) 40]; 41 42module.exports = new BroccoliMergeTrees(nodes);
MIT © outaTiME
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/26 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More