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

grunt-export

v0.9.0

Published

Import javascript dependencies and export to file. Like concat, but it's accept inline files.

Downloads

21

Readme

Grunt Export

Import javascript dependencies and export to file using NodeImport. Like a concat plugin, but it's accept inline files. So we don't need to define all files in grunt config, also not only append the next scripts into previous scripts. We can import files even though the import statement is inside a function block function() {}.

Since the basic function of NodeImport is to execute scripts, you also can run scripts using this plugin, but it's not a main function of this plugin.

Reads the NodeImport to find out how the import and export works.

Getting Started

This plugin requires Grunt ~0.4.5 and NodeImport ~0.1.3.

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-export --save-dev

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

grunt.loadNpmTasks('grunt-export');

The "export" task

Overview

In your project's Gruntfile, add a section named exports to the data object passed into grunt.initConfig().

grunt.initConfig({
  exports: {
    options: {
      // Task options
    },
    your_target: {
      // Target dir and files.
    },
  },
});

Options

options.exec

Type: Boolean Default value: false

Execute scripts while exporting or not.

options.async

Type: Boolean Default value: false

Execute scripts in synchronus mode.

options.export

Type: Boolean Default value: true

Export imported scripts or just execute the scripts.

options.uglify

Type: Boolean Default value: true

Export the minified version to file using UglifyJS.

options.uglifyOptions

Type: Object Default value: null

Uglify options that will be passed to UglifyJS

options.sourcemap

Type: Boolean Default value: true

Export the sourcemap to file.

options.beautify

Type: Boolean Default value: true

Beautify the scripts.

options.noscript

Type: Boolean Default value: false

Mark as non-javascript files.

options.formatter

Type: Function Default value: null

Custom formatter to format/beautify the imported files.

options.verbose

Type: Boolean Default value: false

Logs all activity.

Usage Examples

Default Options

In this example, task using default options and use verbose to logs all activity.

grunt.initConfig({
  exports: {
    test: {
      options: {
        verbose: true
      },
      files: {
        'tmp': ['test/people.js'],
      },
    }
  }
});

Release History

  • 2015-03-30 v0.9.0 "Adding support to concatenate non-javascript files."
  • 2015-03-27 v0.8.0 "Updating NodeImport"
  • 2015-03-08 v0.6.0 "Adding include() module - NodeImport"
  • 2015-03-05 v0.5.0 "Fixing namespace and add return variables as object for imports.module()"
  • 2015-03-05 v0.4.1 "Fixing source-map sources url mistake."
  • 2015-03-05 v0.4.0 "Adding support to import scripts by call it inside a module."
  • 2015-03-05 v0.3.1 "Fixing namespace conflict when using null-extension."
  • 2015-03-05 v0.3.0 "Adding support to ignore file extension using plain object as namespace."
  • 2015-02-26 v0.2.1 "Updating NodeImport."
  • 2015-02-26 v0.2.0 "Updating NodeImport."
  • 2015-02-26 v0.1.9 "Updating NodeImport."
  • 2015-02-25 v0.1.8 "Updating NodeImport version."
  • 2015-02-25 v0.1.7 "Updating NodeImport version."
  • 2015-02-25 v0.1.6 "Fixing namespace and async orders. Renaming export to exports since it's and reserved word."
  • 2015-02-24 v0.1.5 "Updating NodeImport version."
  • 2015-02-24 v0.1.4 "Updating namespace variable getter."
  • 2015-02-21 v0.1.3 "Fixing mistakes with async option."
  • 2015-02-21 v0.1.2 "First release, follow the release version of node-import."