📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

strapi-seed

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-seed

Create seed data for strapi

0.0.9
latest
npm
Version published
Weekly downloads
9
-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

Strapi plugin strapi-seed

Quickly seed your data via JSON files.

Create inside of Strapi admin or copy and paste from your favorite code editor.

Does not support yet:

Components Dynamic zones Images from computer (Does support an array of image URLs!)

Installation

yarn add strapi-seed

Ignore any files that are created in the seed folder, so that your server doesn't restart when seeding.

watchIgnoreFiles: ["**/seeds/**"],

Enable it in your plugins.js file

"strapi-seed": {
  enabled: true
}

Usage

{
  "modelname":
    "field": "value",
}

Example

{
  "customer": [
    "firstName": "John",
    "lastName": "Smith",
    "email": "jsmith@example.com",
    "profilePicture: { images: ["https://aws.johnsmithprofilepic.png"] },
    "products: { relations: ["gym_subscription", "weekly_food_delivery_service"] }
    ]

}

Each file is an array of collection items. In this case an array of JSON objects for the model customer.

  • The related collection must already be created and at the moment can only be linked via a 'name' field. This will change later and be choosable.
  • Images can only be a URL at this time.

If you want to quickstart your JSON file, navigate to strapi-seed in admin and select the model you want to create items for and copy the template that populates. :)

FAQs

Package last updated on 09 Mar 2022

Did you know?

Socket

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