aboutsummaryrefslogtreecommitdiff
path: root/docs/guide/upgrading.md
diff options
context:
space:
mode:
authorShinigami <[email protected]>2022-09-11 20:23:42 +0800
committerGitHub <[email protected]>2022-09-11 14:23:42 +0200
commit8db9d6e8743d080431093b643b0a238d73c422e8 (patch)
treeda45e5432fbc232245922db569dc748af4c113f3 /docs/guide/upgrading.md
parent4efa530e5924e78712c220c9b4f4a0cf41cb5167 (diff)
downloadfaker-8db9d6e8743d080431093b643b0a238d73c422e8.tar.xz
faker-8db9d6e8743d080431093b643b0a238d73c422e8.zip
docs: upgrading guide (#1365)
Co-authored-by: Leyla Jähnig [email protected] Co-authored-by: ST-DDT [email protected]
Diffstat (limited to 'docs/guide/upgrading.md')
-rw-r--r--docs/guide/upgrading.md59
1 files changed, 59 insertions, 0 deletions
diff --git a/docs/guide/upgrading.md b/docs/guide/upgrading.md
new file mode 100644
index 00000000..ac95b6b5
--- /dev/null
+++ b/docs/guide/upgrading.md
@@ -0,0 +1,59 @@
+# Upgrading to v7
+
+This is the migration guide for upgrading from v6 to v7.
+
+::: info
+Not the version you are looking for?
+
+- [v6.fakerjs.dev](https://v6.fakerjs.dev/migration-guide-v5/)
+
+:::
+
+## Node 12 no longer supported
+
+You need at least Node 14 to use Faker.
+
+## Default export removed
+
+If you were previously importing faker like this:
+
+```js
+import faker from '@faker-js/faker';
+```
+
+You must instead use:
+
+```js
+import { faker } from '@faker-js/faker';
+```
+
+## Deprecated methods changed
+
+Several methods were renamed or moved:
+
+| Old method | New alternative |
+| -------------------------- | ------------------------------------------------------ |
+| faker.random.number | faker.datatype.number |
+| faker.random.float | faker.datatype.float |
+| faker.random.arrayElement | faker.helpers.arrayElement |
+| faker.random.arrayElements | faker.helpers.arrayElements |
+| faker.random.objectElement | faker.helpers.objectKey <br> faker.helpers.objectValue |
+| faker.random.uuid | faker.datatype.uuid |
+| faker.random.boolean | faker.datatype.boolean |
+| faker.random.image | faker.image.image |
+| faker.random.hexaDecimal | faker.datatype.hexadecimal |
+| faker.helpers.randomize | faker.helpers.arrayElement |
+| faker.datatype.hexaDecimal | faker.datatype.hexadecimal |
+| faker.name.title | faker.name.jobTitle |
+
+## Deprecated methods removed
+
+Some methods were removed without a direct alternative. If you are using any of these methods you should build an object containing the specific properties you need.
+
+| Removed method |
+| ------------------------------- |
+| faker.helpers.createCard |
+| faker.helpers.contextualCard |
+| faker.helpers.userCard |
+| faker.time |
+| faker.helpers.createTransaction |