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 🙏

© 2025 – Pkg Stats / Ryan Hefner

grunt-depend-concat

v0.1.4

Published

Concatenates files in order via path references

Downloads

5

Readme

grunt-depend-concat

A Grunt task that concatenates files in order via path references.

This task was initially developed to be used in conjunction with grunt-ts for concatenating separately compiled JavaScript files. However, the task's functionality has been expanded to be useful in a variety of ways.

Written in TypeScript.

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile 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-depend-concat --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-depend-concat');

Configuration

method

The method option determines what the task searches for to find dependencies.

JavaDoc-like Tags - doctag

Setting the method.type option to "doctag" will have the task recognize documentation tags matching the method.tag string.

For example, the following method options ...

{
    method: {
        type: 'doctag',
        tag: 'use'
    }
}

... will recognize the following tags as dependencies:

/**
 * @use ../path/to/file.js
 */

XML Tags - xmltag

Setting the method.type option to "xmltag" will have the task recognize documentation tags matching the method.tag string.

For example, the following method options ...

{
    method: {
        type: 'xmltag',
        tag: 'use'
    }
}

... will recognize the following tags as dependencies:

// <use path="../path/to/file.ts" />

/// <use path="../path/to/file.ts" />

The xmltag type has additional options.

The method.attribute and method.prefix options will alter the regular expression used for finding dependencies.

For example, the following method options ...

{
    method: {
        type: 'xmltag',
        tag: 'require',
        attribute: 'src',
        prefix: '<\\!-- *'
    }
}

... will recognize the following tags as dependencies:

<!-- <require src="../path/to/file.ts" />

Presets

TypeScript References

Set the method option to "reference" for TypeScript references to be recognized. The following is an example reference.

/// <reference path="../path/to/file.ts" />

Custom

You can also use a custom method by providing the method option to a literal object with the regex and index properties set.

{
    /**
     * A regular expression used to find the dependencies
     */
    regex: /somefancyregex/gi,

    /**
     * An array index where each dependency's file path
     * can be found from the result of RegExp.exec()
     */
    index: 1
}

separator

File contents separator. Default: "\n"

ignore_ext

When looking for matching dependency files, the file extensions are ignored. Allows TypeScript references (.ts) to discover their compiled (.js) counterparts. Default: true

Example

grunt.initConfig({
    'depend-concat': {
        /* 
            @depends /path/to/dependency.js
        */
        depends_doctag: {
            options: {
                method: {
                    type: 'doctag',
                    tag: 'depends'
                }
            }
            src: ['compiled/files/*.js'],
            dest: 'dist/concat.js'
        },
        /* 
            /// <reference path="../path/to/file.ts" />
        */
        typescript_reference: {
            options: {
                method: 'reference'
            },
            src: ['compiled/files/*.js'],
            dest: 'dist/concat.js'
        },
        /* 
            <!-- <require filepath="../path/to/file.xml" /> -->
        */
        require_xmltag: {
            options: {
                method: : {
                    type: 'doctag',
                    tag: 'require',
                    attribute: 'filepath',
                    prefix: '<\\!-- *'
                },
                ignore_ext: false,
            },
            src: ['compiled/files/*.xml'],
            dest: 'dist/concat.xml'
        },
    }
});

License

Released under the MIT license


(^_^)