Comparing version 0.7.6 to 0.7.7
@@ -10,2 +10,5 @@ import fs from 'fs/promises' | ||
const paths = { | ||
packageJSON: path.join(__dirname, './package.json'), | ||
readmeSrc: path.join(__dirname, './src/_readme.md'), | ||
readmeRoot: path.join(__dirname, './README.md'), | ||
source: path.join(__dirname, './src/db64.js'), | ||
@@ -21,5 +24,9 @@ cjsDist: path.join(__dirname, './dist/db64.cjs'), | ||
const createCJS = async () => { | ||
try { | ||
const data = await fs.readFile(paths.source, 'utf8') | ||
const readmeSrc = await fs.readFile(paths.readmeSrc, 'utf8') | ||
const insertCJSImport = data.replace(/export default db64/g, 'module.exports = db64') | ||
@@ -33,3 +40,3 @@ | ||
console.info(`Created ${paths.esDist}`) | ||
// ES Min | ||
@@ -55,2 +62,10 @@ await fs.writeFile(paths.esMinDist, minifiedESData.code, 'utf8') | ||
const stats = await fs.stat(paths.esMinDist) | ||
// Readme | ||
const fileSizeInKB = stats.size / 1024 | ||
const readmeWithSize = readmeSrc.replace(/{{ size }}/g, `${fileSizeInKB.toFixed(2)}KB`) | ||
await fs.writeFile(paths.readmeRoot, readmeWithSize, 'utf8') | ||
console.info(`Created ${paths.readmeRoot}`) | ||
} catch (err) { | ||
@@ -57,0 +72,0 @@ console.error('Error:', err) |
{ | ||
"name": "db64", | ||
"version": "0.7.6", | ||
"version": "0.7.7", | ||
"description": "A Practical IndexedDB API", | ||
@@ -5,0 +5,0 @@ "main": "db64.js", |
@@ -14,3 +14,3 @@ # db64 | ||
- No versioning | ||
- Around 2kB minified | ||
- 2.47KB minified | ||
@@ -144,5 +144,8 @@ E.g. | ||
### Contributors | ||
Don't hesitate just contribute, it's a tiny library we will figure it out. | ||
Don't hesitate just contribute, it's a tiny library we will figure it out. | ||
If you want to edit `./README.md` edit `./src/_readme.md` which will update `./README.md` when `node create-distribution.js` is called. | ||
This is to keep the minified size accurate. | ||
--- | ||
MIT © Julien Etienne 2023 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39878
9
629
150