Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js support, Creating an NPM package #3

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ MIT LICENSED (http://www.opensource.org/licenses/mit-license.php)

Copyright (c) 2011, Joel Besada

Installation
------
npm install jsmanipulate

Usage
------

Expand Down
15 changes: 0 additions & 15 deletions filter list/index.html

This file was deleted.

35 changes: 0 additions & 35 deletions filter list/style/style.css

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion script/separate filters/vignette.js → filters/vignette.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ function VignetteFilter(){
var outputData = [];
if(values === undefined){ values = this.defaultValues; }
var amount = (values.amount === undefined) ? this.defaultValues.amount : values.amount;
var canvas = document.createElement("canvas");
if(typeof module !== "undefined" && typeof module.exports !== "undefined"){ var canvas = require("canvas"); } // nodejs
else{ var canvas = document.createElement("canvas"); } // browser
canvas.width = width;
canvas.height = height;
var context = canvas.getContext("2d");
Expand Down
File renamed without changes.
9 changes: 7 additions & 2 deletions script/jsmanipulate.js → jsmanipulate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,8 @@ function VignetteFilter(){
var outputData = [];
if(values === undefined){ values = this.defaultValues; }
var amount = (values.amount === undefined) ? this.defaultValues.amount : values.amount;
var canvas = document.createElement("canvas");
if(typeof module !== "undefined" && typeof module.exports !== "undefined"){ var canvas = require("canvas"); } // nodejs
else{ var canvas = document.createElement("canvas"); } // browser
canvas.width = width;
canvas.height = height;
var context = canvas.getContext("2d");
Expand Down Expand Up @@ -2307,4 +2308,8 @@ var JSManipulate = {
twirl : new TwirlFilter(),
vignette : new VignetteFilter(),
waterripple : new WaterRippleFilter()
};
};

// node.js
if (typeof module !== "undefined" && typeof module.exports !== "undefined"){ module.exports = JSManipulate; }

15 changes: 15 additions & 0 deletions minified/jsmanipulate.min.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"author": "Joel Besada",
"name": "jsmanipulate",
"version": "1.0.2",
"description": "JSManipulate is an image filter and effects library written in Javascript for client-side manipulation of images on a web page.",
"main": "jsmanipulate.js",
"license": "MIT",
"keywords": ["canvas", "image", "images", "graphics", "filter", "filters", "manipulation", "manipulate", "distortion", "distort", "effects", "blur", "sharpen", "emboss", "invert"],
"homepage": "http://joelb.me/jsmanipulate/",
"repository": {
"type": "git",
"url": "https://github.com/dholtzmann/JSManipulate.git"
},
"dependencies": {
"canvas": "~1.2.9"
},
"engines": { "node": "*" }
}
Loading