Skip to content

Commit bd6d8ae

Browse files
committed
Updates readme examples
1 parent fb0fa2f commit bd6d8ae

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ A tiny (< 1KB) utility library that transforms the Figma API response into somet
2525
import processFile from 'figma-transformer';
2626

2727
// Fetch the file you want using your favourite method
28-
...
28+
const originalFile = fetchFigmaFile();
2929

30-
const fileData = processFile(originalFile);
30+
const file = processFile(originalFile);
3131

32-
// ✨ You can now use `fileData` for whatever you need! ✨
32+
// ✨ You can now use `file` for whatever you need! ✨
3333

3434
// Let's get the styles for a component named "Test"
35-
const testStyles = data.shortcuts.components
35+
const testStyles = file.shortcuts.components
3636
.find(component => component.name === "Test")
3737
.shortcuts.styles;
3838

@@ -255,21 +255,21 @@ Let's see more specific examples where the benefits of the library really stand
255255
**Getting all text used in a document**
256256

257257
```js
258-
const text = data.shortcuts.texts.map(node => node.characters);
258+
const text = file.shortcuts.texts.map(node => node.characters);
259259
```
260260

261261
**Finding the styles applied to a specific component**
262262

263263
```js
264-
const styles = data.shortcuts.components
264+
const styles = file.shortcuts.components
265265
.filter(component => component.name === "Test")
266266
.map(component => component.shortcuts.styles);
267267
```
268268

269269
**Getting the fill colours for all the rectangles in the first page**
270270

271271
```js
272-
const fills = data.shortcuts.pages
272+
const fills = file.shortcuts.pages
273273
.filter(page => page.name === "Page 1")
274274
.map(page => page.shortcuts.rectangles.fills);
275275
```

0 commit comments

Comments
 (0)