Socket
Socket
Sign inDemoInstall

photon

Package Overview
Dependencies
4
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    photon

JavaScript library for the WordPress.com Photon image manipulation service


Version published
Weekly downloads
17K
increased by8.83%
Maintainers
1
Install size
119 kB
Created
Weekly downloads
 

Readme

Source

photon.js

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).

License

MIT – Copyright 2014 Automattic

Keywords

FAQs

Last updated on 11 Jun 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc