Giter Club home page Giter Club logo

metamorph's Introduction

metamorph

Morphs package meta files into each other.

Currently supports: npm, jamjs, component.

Using Globally

Install globally with: npm install metamorph -g

metamorph component.json jam will generate a jam compatible package.json meta file.

Specify a 3rd arg to change the output filepath: metamorph package.json component /some/path/component.json

Using Locally

Install with: npm install metamorph --save

var metamorph = require('metamorph');
var fs = require('fs');

// convert a component.json into a jam compatible package.json
metamorph('component.json', 'jam', function(err, data) {
  fs.writeFileSync('package.json', data);
});

// and back again
metamorph('package.json', 'component', 'component.json');

Feed it missing/override data:

var metamorph = require('metamorph');

var data = { repo: "shama/custom" };
metamorph('package.json', 'component', data, function(err, p) {
  console.log(JSON.parse(p).repo); // === 'shama/custom'
});

Stream

var metamorph = require('metamorph');
var fs = require('fs');

var mm = metamorph('component.json', 'jam');
mm.pipe(fs.createWriteStream('package.json'));
var Metamorph = require('metamorph').Metamorph;
var fs = require('fs');

var mm = new Metamorph('component');
fs.createReadStream('package.json')
  .pipe(mm)
  .pipe(fs.createWriteStream('component.json'));

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

  • 0.1.0 - Initial release.

License

Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.

metamorph's People

Contributors

shama avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

metamorph's Issues

Normalize/fix meta files

Write a util that fixes common errors in meta files. Such as for some reason people do: "main": ["one.js", "two.css"] in component.json files often when they should use scripts instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.