curl -s -F "file=@./pom.xml" https://license.hiqdev.io/stats | jq
{
"Apache-2.0": 4,
"BSD-2-Clause": 1,
"MIT": 1
}
curl -s -F "file=@./yarn.lock" https://license.hiqdev.io/stats | jq
{
"MIT": 471,
"CC-BY-4.0": 1,
// ... more results ...
}
// Example using Fetch API in JavaScript (Node.js environment)
const fs = require('fs');
const fetch = require('node-fetch');
const fileContents = fs.readFileSync('path/to/your/file.json'); // Replace with your file path
const formData = new FormData();
formData.append('file', fileContents);
fetch('https://license.hiqdev.io/stats', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));