Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
leonardojs
Advanced tools
npm
$ npm install leonardojs
bower
$ bower install leonardo
<!DOCTYPE HTML>
<html>
<body>
//.....
<script src="[bower_componenets|node_modules|other]/leonardo/dist/leonardo.js"></script>
</body>
</html>
** If your app is running angularjs 1.x you will also need to add the Leonardo module as a dependency
<!DOCTYPE HTML>
<html>
<body ng-app="app">
//.....
<script>
var myApp = angular.module("app", ["leonardo"]);
//.....
</script>
</body>
</html>
You should now see Leonardo's icon on the bottom left corner. Start mocking your ajax calls by using the UI or the API
//.....
Leonardo.addStates([
{
name: 'Get Data',
url: '/api/user/43435',
verb: 'GET',
options: [
{name: 'success', status: 200, data: { name: "Master Splinter" }},
{name: 'error 500', status: 500},
{name: 'error 401', status: 401}
]
},
{
name: 'Update Data',
url: '/api/user/43435',
verb: 'PUT',
options: [
{name: 'success', status: 200},
{name: 'error 500', status: 500},
{name: 'error 400', status: 400}
]
}
]);
Activates state option, mocked response will be returned when calling the state url
//.....
Leonardo.activateStateOption('Update Data', 'success');
$http.put('/api/user/43435', { name: "Master Splinter" }).success(function(data, status) {
console.log(status); // 200
});
Leonardo.activateStateOption('Update Data', 'error 500');
$http.put('/api/user/43435', { name: "Master Splinter" }).error(function(data, status) {
console.log(status); // 500
});
//.....
Deactivates a specific state, when calling the state url request will pass through to the server
//.....
Leonardo.deactivateState('Update Data');
//.....
You can hide Leonardo activator icon by clicking ctrl
+ shift
+ l
.
cd
into the project folder
npm install
gulp build
gulp serve
This will run the demo app (and auto-refresh the browser)
Copyright © 2015 MIT License
FAQs
Leonardo - Your mocking ninja - an add-on tool for centralizing your client side mocking
The npm package leonardojs receives a total of 21 weekly downloads. As such, leonardojs popularity was classified as not popular.
We found that leonardojs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.