Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
muggler
Advanced tools
Readme
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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.