
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
gatsby-source-dropbox
Advanced tools
Source plugin for getting data from Dropbox account.
npm install --save gatsby-source-dropbox
Configure the plugin
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-source-dropbox`,
options: {
accessToken: `access-token`,
extensions: ['.pdf', '.jpg', '.png', '.md'],
path: '/path/to/folder',
recursive: false,
createFolderNodes: false,
},
},
]
createFolderNodes: false
The plugin provides some basic information of the remote files such as:
The plugin makes use of the create remote node API of gatsby to locally download all the files in order to use them with other transformer plugins such as gatsby-transformer-sharp for images or gatsby-transformer-remark for markdown files.
Example:
query {
allDropboxNode {
edges {
node {
id
name
lastModified
path
localFile {
childMarkdownRemark {
html
}
}
}
}
}
}
createFolderNodes: true
By setting this to true, you will get the following types in graphql:
allDropboxFolder
allDropboxImage
allDropboxMarkdown
allDropboxNode # everything that's not one of the above, will be of this type
You can now easily query for files within a folder. Lets say you have a simple portfolio structured like this on your dropbox:
.
+-- Project-01-Lorem-Name
| +-- Description.md
| +-- Gallery-Image-01.jpg
| +-- Gallery-Image-02.jpg
+-- Project-02-Ipsum-Name
| +--Description.md
| +--Gallery-Image-01.jpg
| +--Gallery-Image-02.jpg
You can now query like following in gatsby-node.js
and create project pages with a corresponding template:
query MyQuery {
allDropboxFolder(filter: {name: {regex: "/Project/"}}) {
group(field: name) {
nodes {
name
dropboxImage {
localFile {
childImageSharp {
fluid {
src
}
}
}
}
dropboxMarkdown {
localFile {
childMarkdownRemark {
html
}
}
}
}
}
}
}
FAQs
Gatsby source plugin for creating nodes from dropbox API
The npm package gatsby-source-dropbox receives a total of 2 weekly downloads. As such, gatsby-source-dropbox popularity was classified as not popular.
We found that gatsby-source-dropbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.