# Making new modules
To make new modules you'll just need to have this in your file:

```javascript
// These packages are mostly required, not in every module tho.
const superagent = require('superagent');
const fs = require('fs');
const sharp = require('sharp');

module.exports = async (req, res) => {
    if (!req.query.url) {
        res.setHeader('Content-Type', 'application/json');
        res.send(JSON.stringify({
            error: 'URL is required!'
        }))
        return;
    }

    let url = req.query.url;
    if ((!url.toLowerCase().includes('.png')) && (!url.toLowerCase().includes('.gif')) && (!url.toLowerCase().includes('.jpg')) && (!url.toLowerCase().includes('.jpeg'))) return res.send(JSON.stringify({
        error: 'This is not a valid image!'
    }))
    if (!url.includes('http') && !url.includes('.')) {
        res.send(JSON.stringify({
            error: 'A valid URL must be provided!'
        }))
        return;
    }

    let image = await superagent.get(req.query.url).catch(err => { if (err) return res.send(JSON.stringify({ error: 'Failed receiving the image. Check the URL and make sure the image is valid.' })) });
    let img = await sharp(image.body).metadata();

    // Rest of your code here
};