pax_global_header00006660000000000000000000000064131021720550014506gustar00rootroot0000000000000052 comment=e3c3bbc05ebd8f871dfde7c9401736b94c9dbab9 preamble-0.1.0/000077500000000000000000000000001310217205500132735ustar00rootroot00000000000000preamble-0.1.0/.gitignore000066400000000000000000000000451310217205500152620ustar00rootroot00000000000000.DS_Store node_modules npm-debug.log preamble-0.1.0/LICENSE000066400000000000000000000026761310217205500143130ustar00rootroot00000000000000Copyright 2016 Mike Bostock All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. preamble-0.1.0/README.md000066400000000000000000000010061310217205500145470ustar00rootroot00000000000000# Package Preamble Generates a minimalist preamble from a package.json. For example, given a package.json file: ```json { "name": "hello-world", "version": "0.0.1", "homepage": "https://example.com/hello-world", "author": { "name": "Alice Baker", "url": "https://example.com/alice" } } ``` If you run preamble in the same directory as this package.json: ``` preamble ``` You’ll get the following output: ```js // https://example.com/hello-world Version 0.0.1. Copyright 2016 Alice Baker. ``` preamble-0.1.0/bin/000077500000000000000000000000001310217205500140435ustar00rootroot00000000000000preamble-0.1.0/bin/preamble000077500000000000000000000006611310217205500155630ustar00rootroot00000000000000#!/usr/bin/env node var os = require("os"), fs = require("fs"); fs.readFile("package.json", "utf8", function(error, text) { if (error) throw error; var json = JSON.parse(text); process.stdout.write("// " + (json.homepage || json.name) + " Version " + json.version + "." + " Copyright " + (new Date).getFullYear() + " " + json.author.name + (/\.$/.test(json.author.name) ? "" : ".") + os.EOL); }); preamble-0.1.0/package.json000066400000000000000000000010621310217205500155600ustar00rootroot00000000000000{ "name": "package-preamble", "version": "0.1.0", "description": "Generate a tiny preamble from a package.json.", "keywords": [ "json", "es6", "module" ], "homepage": "https://github.com/mbostock/preamble", "license": "BSD-3-Clause", "author": { "name": "Mike Bostock", "url": "https://bost.ocks.org/mike" }, "repository": { "type": "git", "url": "https://github.com/mbostock/preamble.git" }, "bin": { "preamble": "./bin/preamble" }, "scripts": { "postpublish": "git push && git push --tags" } }