@@ -14,14 +14,14 @@ This SDK can also be used with [popular frontend frameworks](https://cloudinary.
14
14
15
15
## Installation
16
16
``` bash
17
- npm install @cloudinary/js- url-gen
17
+ npm install @cloudinary/url-gen
18
18
```
19
19
20
20
## Simple usage
21
21
``` javascript
22
22
23
23
// Import the Cloudinary class
24
- import {Cloudinary } from ' @cloudinary/js- url-gen' ;
24
+ import {Cloudinary } from ' @cloudinary/url-gen' ;
25
25
26
26
// Create your instance
27
27
const cld = new Cloudinary ({
@@ -35,7 +35,7 @@ const cld = new Cloudinary({
35
35
36
36
// Let's create a new image
37
37
const myImage = cld .image (' sample' );
38
- import {Resize } from ' @cloudinary/js- url-gen/actions/resize' ;
38
+ import {Resize } from ' @cloudinary/url-gen/actions/resize' ;
39
39
myImage .resize (Resize .scale ().width (100 ).height (100 ));
40
40
41
41
// When we're done, we can apply all our changes and create a URL.
@@ -56,22 +56,22 @@ console.log(myURL);
56
56
57
57
58
58
### Transpilation
59
- @cloudinary/js- url-gen is shipped as untranspiled ES6 code.
60
- @cloudinary/js- url-gen is optimized around bundle size, as such we do not transpile our distributed modules,
59
+ @cloudinary/url-gen is shipped as untranspiled ES6 code.
60
+ @cloudinary/url-gen is optimized around bundle size, as such we do not transpile our distributed modules,
61
61
we leave the decision of what browsers to support, and what transpilations to apply, to you, the user.
62
62
63
63
### Testing with Jest
64
64
65
- As mentioned above, we're shipping @cloudinary/js- url-gen with ES6 code, as this provides great tree-shaking potential.
65
+ As mentioned above, we're shipping @cloudinary/url-gen with ES6 code, as this provides great tree-shaking potential.
66
66
it also requires a few adjustments when testing.
67
67
68
68
In jest.config, you'll need to add these lines to allow babel to transpile our code.
69
69
``` json
70
70
{
71
71
"transform" : {
72
- "node_modules/@cloudinary/js- url-gen" : " babel-jest"
72
+ "node_modules/@cloudinary/url-gen" : " babel-jest"
73
73
},
74
- "transformIgnorePatterns" : [" /node_modules/(?!@cloudinary/js- url-gen)" ]
74
+ "transformIgnorePatterns" : [" /node_modules/(?!@cloudinary/url-gen)" ]
75
75
}
76
76
```
77
77
Make sure to install babel-jest:
0 commit comments