
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
grunt-path-absolutely
Advanced tools
A grunt plugin for convert relative path to absolutely.
This tool is used to change a resource's path from relative to absolute.
eg:
<img src='./dev/pic1.jpg'/>
converts to:
<img src='https://cdn.xxx.com/img/pic1.jpg'/>
File type is configurable, both main file and resource file.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile.js
as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-path-absolutely --save-dev
Once the plugin has been installed, it may be enabled inside your gruntfile.js
with this line:
grunt.loadNpmTasks('grunt-path-absolutely');
Suppose the project deployment is something like this:
|--project/
|----dev/
|------module/
|--------style.css
|--------srcipt.js
|--------pic.jpg
|--------index.html
|----release/
|------cdn.xxx.com/
|--------module/
|----------style.css
|----------srcipt.js
|----------pic.jpg
|------view/
|--------module/
|----------index.html
Then, add and configure it to your Gruntfile.js:
grunt.initConfig( {
abspath:{
dist:{
options:{
//resource file's actual root, which part you want it to replaced by 'releaseRoot'
devRoot:'dev',
//the absolute root you wanted
releaseRoot:'http://cdn.xxx.com',
//what resource need in to change the root
resourceFilter:['*.{jpg,png,css,js}']
},
files: [ {
expand: true,
//main file(eg:index.html) rootdir
src: [ 'dev/**/*.html' ],
//output main file
dest: 'release/view'
} ]
}
}
} );
Run this task with the grunt abspath
command.
FAQs
A grunt plugin for convert relative path to absolutely.
The npm package grunt-path-absolutely receives a total of 0 weekly downloads. As such, grunt-path-absolutely popularity was classified as not popular.
We found that grunt-path-absolutely demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.