Packages List

The following is a list of all @commodo packages, and some other external ones that you might find useful.

Note that, when using Commodo with Webiny, to make it easier, we've created the @webiny/commodo package, which aggregates all of the relevant @commodo/* and commodo-* packages and lets you import any HOF (or any other construct) within a single import statement. For example:

import { withHooks, withStorage, withFields, string, number } from "@webiny/commodo";

To quickly get up to speed with Commodo and learn best practices, check out the Commodo crash course.

Base packages

PackageShort DescriptionVersionIncluded in @webiny/commodo
@commodo/fieldsThe starting point of every model. Provides base string, number, boolean and model fields.Yes
@commodo/nameAssign a name to your models.Yes
@commodo/hooksProvides methods for defining and triggering hooks on your models.Yes
@commodo/fields-storageEnables saving models to a database (with an appropriate driver, e.g. MySQL).Yes

Additional packages

PackageShort DescriptionVersionIncluded in @webiny/commodo
@commodo/fields-storage-refProvides ref field, for saving references to other models saved in database.Yes
@commodo/fields-storage-mongodbA MongoDB driver for @commodo/fields-storage package.No
@commodo/fields-storage-soft-deleteIntroduces deleted boolean field to mark whether a model was deleted or not, instead of physically deleting the entry in the storage.Yes

Community packages

PackageShort DescriptionVersionIncluded in @webiny/commodo
commodo-fields-dateProvides date field, for saving dates.Yes
commodo-fields-objectProvides object field, for saving plain objects.Yes
commodo-fields-intProvides int field, for saving integer numbers.Yes
commodo-fields-floatProvides float field, for saving float numbers.Yes
commodo-fields-storage-crud-logsAdds and automatically manages createdOn, updatedOn, savedOn fields.Yes
Last updated on by Adrian Smijulj