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

wp-file-header

v2.1.2

Published

Adds 'File Header' to Wordpress Theme's style.css file based on package.json data

Downloads

11

Readme

wp-file-header

Node.js plugin that adds 'File Header' to Wordpress Theme's style.css file based on package.json data

For now works only with style.css file (supports only WP Themes, not plugins)

Installation

$ npm i wp-file-header --save-dev

Description

Creates this: style.css

/*
Theme Name:     Twenty Thirteen
Theme URI:      http://wordpress.org/themes/twentythirteen
Author:         the WordPress team
Author URI:     http://wordpress.org/
Description:    The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
Version:        1.0.0
License:        GNU General Public License v2 or later
License URI:    http://www.gnu.org/licenses/gpl-2.0.html
Tags:           black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
Text Domain:    twentythirteen
Template:       twentytwelve
*/

From this: package.json

{
	"name": "twenty-thirteen",
	"version": "1.0.0",
	"author": "the WordPress team",
	"authoruri": "http://wordpress.org/",
	"homepage": "http://wordpress.org/themes/twentythirteen",
	"description": "The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.",
	"keywords": [
		"black",
		"brown",
		"orange",
		"tan",
		"white",
		"yellow",
		"light",
		"one-column",
		"two-columns",
		"right-sidebar",
		"flexible-width",
		"custom-header",
		"custom-menu",
		"editor-style",
		"featured-images",
		"microformats",
		"post-formats",
		"rtl-language-support",
		"sticky-post",
		"translation-ready"
	],
	"themename": "Twenty Thirteen",
	"textdomain": "twentythirteen",
	"license": "GNU General Public License v2 or later",
	"licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
	"template": "twentytwelve"
}

Usage

Plain

var wp = require('wp-file-header')('./package.json');
wp.patch('./style.css', function(err){
	// done
});

or just

var wp = require('wp-file-header')();
wp.patch();

With Gulp:

var gulp = require('gulp'),
	wp   = require('wp-file-header')('./package.json');

gulp.task('wp', function () {
	wp.patch('./style.css', function(err){
		// done
	});
});

With Grunt:

module.exports = function(grunt) {
	var wp = require('wp-file-header')('./package.json');
	grunt.registerTask('wp', function() {
		var done = this.async();
		wp.patch('./style.css', function(err){
			done();
		});
	});
};