Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
grunt-fetch-json
Advanced tools
Readme
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-fetch-json --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('fetchJson');
The goal here is simply to allow fetching of remote data sources for use in your app. A couple use cases include:
I'm sure the community will come up with plenty of other interesting use cases for this tool. Get creative!
In your project's Gruntfile, add a section named fetchJson
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
fetchJson: {
options: {
// Task-specific options go here.
},
your_files: {
// Target-specific file lists and/or options go here.
},
},
})
Type: String
Default value: 'GET'
A string value that is passed with the fetch request.
Type: Object
Default value: {}
An object with keys and values you'd like passed with the fetch request.
Type: Object
Default value: {}
An object with keys and values you'd like passed with the fetch request.
Type: Object
Default value: {}
An object with keys and values you'd like appended to the request url.
In this example, the default options are used to grab some json and stash it in a local file.
grunt.initConfig({
fetchJson: {
files: {
'data/remote_data1.json': 'http://jsonplaceholder.typicode.com/posts/1'
}
},
})
In this example, we're fetching multiple files, in parallel.
grunt.initConfig({
fetchJson: {
files: {
'tmp/remote_data2.json': 'http://jsonplaceholder.typicode.com/posts/2',
'tmp/remote_data3.json': 'http://jsonplaceholder.typicode.com/posts/3'
}
},
})
Fetch json from an api with tokens or keys.
grunt.initConfig({
fetchJson: {
options: {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
parameters: {
access_token: '555'
}
},
files: {
'tmp/shirts.json': 'https://yourapi.com/shirts',
'tmp/pants.json': 'https://yourapi.com/pants'
}
},
})
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2015 Adam Argyle. Licensed under the MIT license.
FAQs
Fetch and stash remote resources
The npm package grunt-fetch-json receives a total of 6 weekly downloads. As such, grunt-fetch-json popularity was classified as not popular.
We found that grunt-fetch-json 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.