From ca066fc79f0e9f54031b84e5c2bb483e097231b1 Mon Sep 17 00:00:00 2001 From: Danish Yasin <47951155+danishyasin33@users.noreply.github.com> Date: Tue, 8 Sep 2020 13:49:19 +0500 Subject: [PATCH 1/5] Updated ReadMe with new tags --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f4ec886..f011b29 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # LibPixel +[![NPM Version](https://img.shields.io/npm/v/imgix.js.svg)](https://www.npmjs.com/package/libpixel) [![Build Status](https://travis-ci.org/libpixel/libpixel-js.svg?branch=master)](https://travis-ci.org/libpixel/libpixel-js) +[![Minified Size](https://img.shields.io/bundlephobia/min/imgix.js)](https://bundlephobia.com/result?p=libpixel) +[![License](https://img.shields.io/github/license/imgix/imgix.js)](https://github.com/libpixel/libpixel-js/blob/master/LICENSE) JavaScript library to generate and sign LibPixel URLs. From 7f95f1ade914d32d533bc719445b8e5bc2cad37e Mon Sep 17 00:00:00 2001 From: Danish Yasin <47951155+danishyasin33@users.noreply.github.com> Date: Wed, 9 Sep 2020 10:49:12 +0500 Subject: [PATCH 2/5] Updated header of ReadMe --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f011b29..3de3db9 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # LibPixel +`libpixel.js` allows developers to use the services of LibPixel in their web applications without having to rely on other dependencies. The service allows you to generate and sign URLs. + [![NPM Version](https://img.shields.io/npm/v/imgix.js.svg)](https://www.npmjs.com/package/libpixel) [![Build Status](https://travis-ci.org/libpixel/libpixel-js.svg?branch=master)](https://travis-ci.org/libpixel/libpixel-js) [![Minified Size](https://img.shields.io/bundlephobia/min/imgix.js)](https://bundlephobia.com/result?p=libpixel) [![License](https://img.shields.io/github/license/imgix/imgix.js)](https://github.com/libpixel/libpixel-js/blob/master/LICENSE) -JavaScript library to generate and sign LibPixel URLs. +--- ## Install From f3c524aee604610f35d124591c7e983f69324717 Mon Sep 17 00:00:00 2001 From: Danish Date: Wed, 9 Sep 2020 11:37:02 +0500 Subject: [PATCH 3/5] Updated Readme.md final --- README.md | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3de3db9..63148a4 100644 --- a/README.md +++ b/README.md @@ -9,29 +9,40 @@ --- +## Introduction + +With the help of `libpixel.js` you can generate responsive images by defining the paremeters and letting the library generate the signed URLs. The generated and signed URLs can be used by setting the `src` attribute of the `img` element. `picture` element can be used to create a more responsive system that loads specific images according to the resolution and orientation of devices. + ## Install -```bash -$ npm install libpixel -``` +There are two ways to install `libpixel.js`: + + +1: **npm**: `$ npm install libpixel` +2: **Manually**: Download the [latest release](https://github.com/libpixel/libpixel-js/releases) and use the JavaScript files in the `src` folder. + ## Usage -Start by requiring the module and creating an instance of the client. +`libpixel.js` is pretty simple to get started with. You just start by requiring the module and creating an instance of the client. The only required attribute is `host`, which should contain your LibPixel `domain` that you will setup while [signing up](https://dashboard.libpixel.com/users/sign_up). ```js var LibPixel = require("libpixel"); -var libpx = new LibPixel({ host: "test.libpx.com" }); +var libpx = new LibPixel({ host: "your-domain.libpx.com" }); ``` -In addition to `host`, the following options are supported: +In addition to `host`, the following attributes are supported: * `secret`: Auth secret for your LibPixel account. Required for signing requests. * `https`: Generate HTTPS URLs. Default is `false`. +After initializing the LibPixel client, you are ready to start using `libpixel.js`. With the help of it, you can sign existing URLs to enable LibPixel support by using the `sign()` method, or you can generate and sign new URLs at the same time by using the `url()` method of the LibPixel client. + +Regardless of what method you use, the output will be a signed URL, which can then use in the `src` attribute of your `img` elements to provide processed images that meet your requirements. + ### Sign URLs -You can sign an existing URL using the `sign` function: +You can sign an existing URL using the `sign()` method: ```js var url = libpx.sign("http://test.libpx.com/images/1.jpg?width=400"); @@ -39,7 +50,7 @@ var url = libpx.sign("http://test.libpx.com/images/1.jpg?width=400"); ### Generate URLs -You can also generate and sign URLs at the same time with the `url` function: +You can also generate and sign URLs at the same time with the `url()` method: ```js var url = libpx.url("/images/1.jpg", { height: 400, blur: 20, saturation: -80 }); @@ -47,4 +58,4 @@ var url = libpx.url("/images/1.jpg", { height: 400, blur: 20, saturation: -80 }) ## License -[MIT](LICENSE) +`libpixel.js` is owned by [LibPixel](https://www.libpixel.com/)and is licensed under the [MIT](LICENSE) license. Contributions are welcomed, please review [contributing guidelines]() to get started. From c4f98ee467196a4b3c39419d2c44a222b61a5bf5 Mon Sep 17 00:00:00 2001 From: Danish Date: Wed, 9 Sep 2020 11:43:20 +0500 Subject: [PATCH 4/5] Updated badges --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 63148a4..510baed 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ `libpixel.js` allows developers to use the services of LibPixel in their web applications without having to rely on other dependencies. The service allows you to generate and sign URLs. -[![NPM Version](https://img.shields.io/npm/v/imgix.js.svg)](https://www.npmjs.com/package/libpixel) +[![NPM Version](https://img.shields.io/npm/v/libpixel)](https://www.npmjs.com/package/libpixel) [![Build Status](https://travis-ci.org/libpixel/libpixel-js.svg?branch=master)](https://travis-ci.org/libpixel/libpixel-js) -[![Minified Size](https://img.shields.io/bundlephobia/min/imgix.js)](https://bundlephobia.com/result?p=libpixel) -[![License](https://img.shields.io/github/license/imgix/imgix.js)](https://github.com/libpixel/libpixel-js/blob/master/LICENSE) +[![Minified Size](https://img.shields.io/bundlephobia/min/libpixel)](https://bundlephobia.com/result?p=libpixel) +[![License](https://img.shields.io/github/license/libpixel/libpixel-js)](https://github.com/libpixel/libpixel-js/blob/master/LICENSE) --- @@ -58,4 +58,4 @@ var url = libpx.url("/images/1.jpg", { height: 400, blur: 20, saturation: -80 }) ## License -`libpixel.js` is owned by [LibPixel](https://www.libpixel.com/)and is licensed under the [MIT](LICENSE) license. Contributions are welcomed, please review [contributing guidelines]() to get started. +`libpixel.js` is owned by [LibPixel](https://www.libpixel.com/) and is licensed under the [MIT](LICENSE) license. Contributions are welcomed, please review [contributing guidelines]() to get started. From b2057cd892bd32916e22d6ed850858b27f560d1e Mon Sep 17 00:00:00 2001 From: Danish Date: Tue, 15 Sep 2020 16:12:00 +0500 Subject: [PATCH 5/5] Removed contributions link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 510baed..498130b 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,4 @@ var url = libpx.url("/images/1.jpg", { height: 400, blur: 20, saturation: -80 }) ## License -`libpixel.js` is owned by [LibPixel](https://www.libpixel.com/) and is licensed under the [MIT](LICENSE) license. Contributions are welcomed, please review [contributing guidelines]() to get started. +`libpixel.js` is owned by [LibPixel](https://www.libpixel.com/) and is licensed under the [MIT](LICENSE) license. Contributions are welcomed. \ No newline at end of file