Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const spiralloop = require('spiralloop')
const generations = require('flying-squid').generations
const { promisify } = require('util')
const fs = require('fs')
const { level } = require('prismarine-provider-anvil')
const fsStat = promisify(fs.stat)
const fsMkdir = promisify(fs.mkdir)
module.exports.server = async function (serv, { version, worldFolder, generation = { 'name': 'diamond_square', 'options': { 'worldHeight': 80 } } } = {}) {
const World = require('prismarine-world')(version)
const newSeed = generation.options.seed || Math.floor(Math.random() * Math.pow(2, 31))
let seed
let regionFolder
if (worldFolder) {
regionFolder = worldFolder + '/region'
try {