<commit_before>require('dotenv').config();

if (!process.env.SONGKICK_API_KEY) {
  return console.error('❗ Failed to load in the SONGKICK_API_KEY. Is it missing from the `.env` file?');
}

const fetch = require('node-fetch');
const getColors = require('get-image-colors');

const low = require('lowdb');
const FileSync = require('lowdb/adapters/FileSync');
const adapter = new FileSync('data/db.json');
const db = low(adapter);

// set some defaults if database file is empty
db.defaults({ colors: [] }).write();

const getColor = (buffer) => new Promise(resolve => {
  getColors(buffer, 'image/jpeg')
    .then(colors => colors[0]._rgb)
    .then(color => {
      resolve(`rgb(${color.slice(0, -1).join(',')})`);
    })
    .catch(error => {<commit_msg>Exit correctly in Songkick file if no ENV<commit_after>require('dotenv').config();

if (!process.env.SONGKICK_API_KEY) {
  console.error('❗ Failed to load in the SONGKICK_API_KEY. Is it missing from the `.env` file?');
  process.exit();
}

const fetch = require('node-fetch');
const getColors = require('get-image-colors');

const low = require('lowdb');
const FileSync = require('lowdb/adapters/FileSync');
const adapter = new FileSync('data/db.json');
const db = low(adapter);

// set some defaults if database file is empty
db.defaults({ colors: [] }).write();

const getColor = (buffer) => new Promise(resolve => {
  getColors(buffer, 'image/jpeg')
    .then(colors => colors[0]._rgb)
    .then(color => {
      resolve(`rgb(${color.slice(0, -1).join(',')})`);
    })
    .catch(error => {
{'fraction_non_alphanumeric': 0.18487394957983194, 'fraction_numerical': 0.003878474466709761, 'mean_word_length': 4.469964664310954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2836783', 'n_tokens_mistral': 518, 'n_tokens_neox': 516, 'n_words': 129}