
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Muggler is a node.js module for using Google Drive API in a simplified way.
Muggler is a node.js module for using Google Drive API in a simplified way.
NOTE: Muggler process only multipart/form-data
. Use attribute enctype='multipart/form-data'
in form.
Create project on Google Cloud Platform and enable Google Drive API.
Check this for step by step tutorial.
$ npm install muggler --save
const config = require('../path/to/secret/config.json');
const muggler = require('muggler')({
email: config.client_email,
key: config.private_key
});
listAll
app.get('/', function (req, res) {
muggler.listAll({infolder: 'folderid'}, function (err, resp) {
if (err) {
console.log(err);
}
res.send(resp);
})
})
infolder
accepts 'string' and 'array' value only.- for root folder of drive use
root
as 'folderid'.- infolder: [folder1id, folder2id] will get files whose parent folder is either folder1 or folder2 that is, all files inside folder1 and folder2 will be in response.
// Response structure
{
status: 'status of operation',
mug: [
{
kind: 'kind of file',
id: 'id of file',
name: 'name of file',
mimeType: 'type of file'
},
{
kind: 'kind of file',
id: 'id of file',
name: 'name of file',
mimeType: 'type of file'
}
]
}
upOne
app.post('/', function (req, res) {
muggler.upOne({fromfield: 'fieldname', infolder: 'folderid'}, req, function (err, resp) {
if (err) {
console.log(err);
}
res.send(resp);
})
})
fromfield
accepts 'string' value only.- fieldname should be name of the input field which will accept file in form.
infolder
accepts 'string' and 'array' value only.- for root folder of drive use
root
as 'folderid'.- infolder: [folder1id, folder2id] will upload file to folder1 and folder2 both with same id.
// Response structure
{
file: {
fieldname: "name of input field",
originalname: "original name of file",
encoding: "encoding type",
mimetype: "type of file",
destination: "temporary destination",
filename: "changed name of file",
path: "tempporary location of file",
size: 'size of file'
},
status: "status of operation",
mug: {
id: "id of file",
name: "name of file",
mimeType: "type of file",
size: 'size of file',
parents: [
"parent folder id"
],
url: "url of file"
},
body: {
otherFormField: "value in field"
}
}
delOne
app.post('/', function (req, res) {
muggler.delOne({fileid: 'id of file'}, req, function (err, resp) {
if (err) {
console.log(err);
}
res.send(resp);
})
})
fileid
accepts 'string' value only.
// Response structure
{
status: "status of operation",
mug: []
}
client_email
.
FAQs
Muggler is a node.js module for using Google Drive API in a simplified way.
The npm package muggler receives a total of 0 weekly downloads. As such, muggler popularity was classified as not popular.
We found that muggler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.