コード例 #1
0
ファイル: test.js プロジェクト: StevenWeathers/svelte
const glob = require("tiny-glob/sync.js");

require("./setup");

glob("*/index.js", { cwd: "test" }).forEach(function(file) {
	require("./" + file);
});
コード例 #2
0
ファイル: update.js プロジェクト: StevenWeathers/svelte
// this file will replace all the output.json files with their _actual.json
// equivalents. Only use it when you're sure that you haven't
// broken anything!
const fs = require("fs");
const glob = require("tiny-glob/sync.js");

glob("samples/*/_actual.json", { cwd: __dirname }).forEach(file => {
	const actual = fs.readFileSync(`${__dirname}/${file}`, "utf-8");
	fs.writeFileSync(
		`${__dirname}/${file.replace("_actual.json", "output.json")}`,
		actual
	);
});