0.11.0 • Published 7 years ago

sweets-brittle v0.11.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

Discontinued! Check Matter In Motion framework.

Brittle

File uploads and processing

File upload

Brittle accepts files via XHR2.

Settings

this.file = {
  options: {
    url: '/static/uploads',                     // file urls
    path: path.join(home, 'static', 'uploads'), // files storage root.
    media: path.join(this.mediaPath, 'mask'),   // path to masks etc.
    processors: [ 'image' ]                     // processors to load
  },

  images: {                                     // name of job settings
    types: [ 'jpg', 'gif', 'png' ],             // file types to be accepted
    path: 'nodes/:year/:month',                 // files storage path (:year, :month, :day will be replaced with current date parts)
    jobs: [
      { 'image:resize': { name: 'l', width: 2400, height: 1600, quality: 50, crop: 'fit', upscale: false } },
      { 'image:resize': { name: 'm', width: 1200, height: 800, quality: 70, crop: 'fit', upscale: false } }
    ]
  }
};

File processors

Brittle has only one built-in processor fs with the following methods:

  • copy copies file
  • move moves file
  • mkdir makes directory recursively
  • delete deletes file

External processors:

For processors methods and options go to processors docs.

API

Brittle is presented by file resource.

process

{
  job: "name of the job to process files with"
  ratio: "force aspect ratio for image resize processor"
}
0.11.0

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.4

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago

0.8.3

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.6.7

8 years ago

0.6.6

8 years ago

0.6.5

9 years ago

0.6.2

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.3.10

10 years ago

0.3.9

10 years ago

0.3.7

10 years ago

0.3.5

10 years ago

0.2.2

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.0.1

10 years ago