Skip to content

Commit

Permalink
Using ES Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeymond committed Mar 27, 2024
1 parent 013c3ba commit 9274504
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// Export as named exports
module.exports.MulterSaveFilesOrgStorage = require('./lib/multer-savefilesorg-storage.js')
import multerSavefilesorgStorage from "./lib/multer-savefilesorg-storage.js"

export const MulterSaveFilesOrgStorage = multerSavefilesorgStorage;
8 changes: 4 additions & 4 deletions lib/multer-savefilesorg-storage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var axios = require('axios')
var concat = require('concat-stream')
var FormData = require('form-data')
import axios from 'axios'
import concat from 'concat-stream'
import FormData from 'form-data'

/*
This is a custom multer storage engine that orxy the received data into a savefiles.org drive.
Expand Down Expand Up @@ -51,6 +51,6 @@ class MulterSaveFilesOrgStorage {
}
}

module.exports = opts => {
export default opts => {
return new MulterSaveFilesOrgStorage(opts)
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "multer-savefilesorg-storage",
"version": "1.0.4",
"version": "1.0.5",
"description": "Forward multipart/form-data file upload into a savefiles.org drive.",
"main": "index.js",
"type": "module",
"exports": "./index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down

0 comments on commit 9274504

Please sign in to comment.