Comments (6)
Have you tried using retire.js directly in your gulpfile? Usually you don`t need a plugin in gulp for tasks ( see gulp plugin guidelines), you just use the node modules directly. I haven't tried this myself.. we should probably have an example configuration in the readme.
from retire.js.
Sounds like something we definitely should do!
Any of you up for the challenge?
from retire.js.
Just wanted to share my two cents:
@kozmic, you're definitely right, if you can use a node module directly, you could probably whip up a custom task pretty easily. Thats a problem for retire.js though, because (correct me if i'm wrong) as far as I can tell, there is no exported function from the retire package that you can use for this. The only way of doing this would be taking a lot of code from the cli wrapper and putting it into a custom gulp task. So for that matter, a gulp plugin might be a considerable option.
That being said, there is always the option of keeping it very simple and just use the cli to run when a .js file, the bower.json or package.json file changes. Which could look something like this:
gulp.task('retire', function (done) {
gulp.watch('package.json', function() {
child_process.spawn('retire', ['--node'], {
stdio: 'inherit'
}).once('close', done);
});
});
With a few simple adjustments you could send the streamed response data from the process to the gulp log.
Personally, I'm not thrilled by spawning child processes to run bash stuff, but then again, as log as there is no real way to talk to retire through a require, this might be the best option. Also, even if you were able to talk directly to retire, you still couldn't use gulp's piping system to its full potential because retire will read the file content again instead of taking it from the gulp pipe.
I'd be happy to whip up an example gulp task for this repo, let me know if you agree with my conclusions (or if you don't :)
from retire.js.
@jellekralt I agree with all your comments. Until we have time to refactor the API from retire.js, so it can be used easly with gulp, I would really appreciate an update to Readme.md with an gulp example :)
from retire.js.
One small question regarding to the usage of retirejs
. Should we need to install npm package globally to run this with gulp
or can we run through devDependencies?
from retire.js.
@peterkr You don't need it globally installed, it can be included in devDependencies. But note that then the retire
executable will be in node_modules/.bin/retire
.
As an example, npm run retire
will execute retire from a locally installed retire through devDependencies
with this package.json:
{
"name": "retirejs-example",
"scripts": {
"retire": "node_modules/.bin/retire"
},
"devDependencies": {
"retire": "*"
}
}
from retire.js.
Related Issues (20)
- Invalid property name, because of zod lib HOT 1
- Downstream dependency vm2 has critical vulnerability CVE-2023-29017 HOT 11
- Retire not generating correct purl when creating cyclonedx bom
- Can retire generate cyclonedx SBOM for all the js scanned and not just vulnerable js HOT 4
- Can retire generate cyclonedx SBOM with license of library HOT 1
- purl of moment.js is still wrong
- purl generated for few components as part cyclonedx BOM is incorrect HOT 1
- purl for datatables incorrect
- Complete type definitions for npm package HOT 4
- Require Support HOT 9
- Bug in JSZip extractor
- --ignore does not ignore given application subdirectory HOT 3
- --outputformat json flag doesn't seem to work HOT 12
- False Positive of momentjs cve-2022-24785 HOT 4
- Invalid jsrepository.json HOT 2
- wrong package version is being reported for lodash HOT 2
- Upstream code from third party maintained browser plugins HOT 3
- Add Mathjax to the repository HOT 2
- Unable to build Chrome Extension HOT 5
- False positive with axios and version string inside comments in axios-mock-adapter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retire.js.