Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-domman

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-domman

Grunt plugin for DOM manipulation

  • 0.1.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

grunt-domman

Grunt plugin for DOM manipulation

Getting Started

安装插件:

npm install grunt-domman --save-dev

加载 grunt 任务:

grunt.loadNpmTasks('grunt-domman');

The "domman" task

Overview

在 Gruntfile.js 的 grunt.initConfig 中增加一个命名为 domman 的配置项:

grunt.initConfig({
  domman: {
    options: {
      plugins: ['tms', 'offline'],			// 要启用的插件
      orderHead: ['offline', 'custom'],				// 优先调用的插件
      orderTail: [],							// 最后要调用的      插件
      custom: function ($) {
      	$('title').text('xxx');
      },
    },
    files: [
      {...}
    ]
  },
})

配置项

options.plugins

Type: Array Default value: ['tms', 'offline', '...']

要调用的 dom 操作插件,在 grunt-domman 模块的 plugins 目录下,默认值为 plugins 目录下的所有插件。

options.orderHead

Type: Array Default value: []

需要首先调用的 plugins。

options.orderTail

Type: Array Default value: []

需要最后调用的 plugins。

options.custom

Type: Function Default value: null

用户自定义的 dom 操作,如果需要指定这个自定义的操作的位置,在 pluginsorderHeadorderTail 中指定 "custom" 字符串位置即可,默认最后执行

Release History

0.1.0

  • [!] 初始版本,支持 tmsoffline 插件

0.1.1

  • [!] 替换 options.prior 配置项为 options.orderHeadoptions.orderTail 两个配置项

0.1.2

  • [+] 支持 custom 配置项定制规则

0.1.4

  • [+] 更新 load.js 支持 js 脚本 onload 后加载
  • [!] offline.js 支持 angular seed 替换

0.1.5

  • [!] 更新 load.js 对包含 KISSY<script> 标签包含 <main> 的行内 js 默认做 onload 加载

License

Copyright (c) 2014 弘树. Licensed under the MIT license.

Keywords

FAQs

Package last updated on 03 Dec 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc