GithubHelp home page GithubHelp logo

isabella232 / photon.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from automattic/photon.js

0.0 0.0 0.0 96 KB

JavaScript library for the WordPress.com Photon image manipulation service

License: MIT License

Makefile 8.30% JavaScript 91.70%

photon.js's Introduction

This repository has moved!

It is now part of the Calypso repository.

The published npm package will continue to be available as before, no changes necessary!

photon.js

Build Status

JavaScript library for the WordPress.com Photon image manipulation service.

How to use

Node.js

Install for Node.js via npm:

$ npm install photon

Now you can simply require('photon') in your module to generate Photon URLs.

var photon = require('photon');

var url = photon('https://cloudup.com/logo/cloudup-salmon-logo.png')

console.log(url);
// https://i2.wp.com/cloudup.com/logo/cloudup-salmon-logo.png

Browser

Include dist/photon.js in a <script> tag. A photon global variable function is exposed:

<script src="photon.js"></script>
<script>
  var url = photon('https://cloudup.com/logo/cloudup-salmon-logo.png')

  console.log(url);
  // https://i2.wp.com/cloudup.com/logo/cloudup-salmon-logo.png
</script>

You can also consume photon.js via browserify when installed via npm (see Node.js instructions above).

Terms of Service

  • Use of this service is for users of the Jetpack by WordPress.com plugin only, and may be used by sites hosted on WordPress.com, on Jetpack-connected WordPress sites, or sites who have gotten special permission from Automattic Inc. If you move to another platform, or disconnect Jetpack from your site, we can’t promise it will continue to work.

  • Abuse of the Jetpack by WordPress.com Terms of Service could result in suspension of your site from WordPress.com-connected services. By enabling Photon you agree to be responsible in what you publish; in particular be sure that you don’t use the service for prohibited items (things like spam, viruses, or hate content). WordPress.com reserves the right, in its sole discretion, to temporarily or permanently revoke your ability to use and access Photon, with or without notice.

License

MIT – Copyright 2014-2018 Automattic

photon.js's People

Contributors

tootallnate avatar sirreal avatar blowery avatar rralian avatar retrofox avatar danreylop avatar

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.