Set package's main and re-export the utilities at it.
This commit is contained in:
parent
251f55538b
commit
3393883c52
|
@ -1,11 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "userstyles",
|
"name": "userstyles",
|
||||||
"description": "A collection of all my userstyles for various websites.",
|
"description": "A collection of all my userstyles for various websites.",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"author": "Bauke <me@bauke.xyz>",
|
"author": "Bauke <me@bauke.xyz>",
|
||||||
"homepage": "https://bauke.xyz/userstyles",
|
"homepage": "https://bauke.xyz/userstyles",
|
||||||
"repository": "https://git.holllo.cc/Bauke/userstyles",
|
"repository": "https://git.holllo.cc/Bauke/userstyles",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"main": "source/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "nodemon 'source/index.js' --watch 'source/' --ext 'scss'",
|
"start": "nodemon 'source/index.js' --watch 'source/' --ext 'scss'",
|
||||||
"build": "USERSTYLE_ENV='production' node 'source/index.js'",
|
"build": "USERSTYLE_ENV='production' node 'source/index.js'",
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
const {promises: fsp} = require('fs');
|
const {promises: fsp} = require('fs');
|
||||||
const {join} = require('path');
|
const {join} = require('path');
|
||||||
|
|
||||||
const {createUserstyle} = require('./utilities');
|
const {
|
||||||
|
createUserstyle,
|
||||||
|
readStyleMetadata,
|
||||||
|
styleHasImages
|
||||||
|
} = require('./utilities');
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// Make sure the `build/` directory exists.
|
// 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.
|
// Export the `main()` function as `build()` for external use.
|
||||||
module.exports = {
|
module.exports = {
|
||||||
build: main,
|
build: main,
|
||||||
styles
|
styles,
|
||||||
|
// Utilities.
|
||||||
|
createUserstyle,
|
||||||
|
readStyleMetadata,
|
||||||
|
styleHasImages
|
||||||
};
|
};
|
||||||
|
|
||||||
// Run `main()` if this script was called directly (like `node source/index.js`).
|
// Run `main()` if this script was called directly (like `node source/index.js`).
|
||||||
|
|
Loading…
Reference in New Issue