1
Fork 0

Set package's main and re-export the utilities at it.

This commit is contained in:
Bauke 2020-08-03 14:31:38 +02:00
parent 251f55538b
commit 3393883c52
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 12 additions and 3 deletions

View File

@ -1,11 +1,12 @@
{
"name": "userstyles",
"description": "A collection of all my userstyles for various websites.",
"version": "0.1.0",
"version": "0.1.1",
"author": "Bauke <me@bauke.xyz>",
"homepage": "https://bauke.xyz/userstyles",
"repository": "https://git.holllo.cc/Bauke/userstyles",
"license": "MIT",
"main": "source/index.js",
"scripts": {
"start": "nodemon 'source/index.js' --watch 'source/' --ext 'scss'",
"build": "USERSTYLE_ENV='production' node 'source/index.js'",

View File

@ -1,7 +1,11 @@
const {promises: fsp} = require('fs');
const {join} = require('path');
const {createUserstyle} = require('./utilities');
const {
createUserstyle,
readStyleMetadata,
styleHasImages
} = require('./utilities');
async function main() {
// Make sure the `build/` directory exists.
@ -23,7 +27,11 @@ const styles = ['tildes-baukula', 'tildes-compact'];
// Export the `main()` function as `build()` for external use.
module.exports = {
build: main,
styles
styles,
// Utilities.
createUserstyle,
readStyleMetadata,
styleHasImages
};
// Run `main()` if this script was called directly (like `node source/index.js`).