
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.
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 27 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.
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.