npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-control-version

v1.0.4

Published

control version filename.

Downloads

3

Readme

gulp-control-version

gulp-control-version is a gulp plugin to update modules easily.

[En] gulp-control-version is a plugin to rename file with the addition of version.

[Ru] gulp-control-version переименовывает конечный файл, добавляя к нему префикс, с уникальным неповторяющимся индексом.

Install

npm install  gulp-control-version --save-dev

Usage

Then, add it to your gulpfile.js:

var conver = require('gulp-control-version');



//-----------gulp-control-version-----------
gulp.task('v-concat_css_1',  function () { //
    conver.rewrite({
                   resdir: "basic/components/widgets/assets/css/",
                   namefile: "-general_style-min.css", 
                   dirrefactor: ["basic/assets/", ["NavbarAsset.php","NavbarAsset_transparent.php"]], 
                   namerefactor: "-general_style-min",
                   codname: "utf-8"
                  });
});
//------------------------------------------

Example

var conver = require('gulp-control-version');
//-----------CONCAT-------------------------
gulp.task('concat_js_1', ['compress-js'], function () {
    return gulp.src(['./src/js/js_min/navbar_animate_button-min.js' , './src/js/js_min/navbar_mobilemenu-min.js'])
      .pipe(concat(conver('./basic/components/widgets/assets/js/','-navbar.js')+'-navbar.js'))
      .pipe(gulp.dest("./basic/components/widgets/assets/js/"));
});
//------------------------------------------

//-----------gulp-control-version-----------
gulp.task('v-concat_js_1', ['concat_js_1'], function () { 
  conver.rewrite({
                resdir: "basic/components/widgets/assets/js/",
                namefile: "-navbar.js", 
                dirrefactor: ["basic/assets/", ["NavbarAsset.php"]]
              });
});
//------------------------------------------

OR

1

basic/components/widgets/assets/css/123423198-general_style-min.сss

2

var conver = require('gulp-control-version');
//-----------CSSNANO-------------------------
gulp.task('cssnano', function () {
    return gulp.src('src/css/css/**/*.css')
        .pipe(nano({
            autoprefixer: {
                browsers: ['last 16 versions'],
                add: true
            }
        }))
        //gulp - rename
        //-----------------------------
        .pipe(rename({
              basename: conver('./basic/components/widgets/assets/css/','-general_style-min.сss')+"aloha",
            }))
        //-----------------------------
        .pipe(gulp.dest('src/css/css_min/'));
});
//------------------------------------------

//-----------gulp-control-version-----------
gulp.task('v-concat_js_1', ['cssnano'], function () { 
  conver.rewrite({
                resdir: "basic/components/widgets/assets/css/",
                namefile: "-general_style-min.сss", 
                dirrefactor: ["basic/assets/", ["NavbarAsset.php"]]
              });
//------------------------------------------

3

basic/components/widgets/assets/css/313787045-general_style-min.сss

4

NavbarAsset.php

class NavbarAsset extends AssetBundle
{
    public $sourcePath = '@app/components/widgets/assets';
    public $css = [
        'css/313787045-general_style-min',
    ];
    public $js = [
        'js/lib/jquery.color-2.1.0.min.js',
        'js/317260467-navbar.js'
    ];
}

API

rewrite({resdir, namefile , dirrefactor, namerefactor , codname})

  • resdir

    Resource file directory

  • namefile

    Resource file name

  • dirrefactor[url,[filename]]

    • url
    File directory that connects resources
    
    dirrefactor: ["URL", ["NavbarAsset.php"]]
    
    Exmample: dirrefactor: ["basic/assets/", ["NavbarAsset.php"]]
    • filename
    The file name in which you want to rename the resource name
  • namerefactor

    • namerefactor = namefile ('Default')

      Resource file name, which will be connected

  • codname

    • codname = "utf-8" ('Default')

      Encoding

Bugs

License

MIT License