Skip to content

Commit 8941cea

Browse files
committed
ESM: add named exports, changelog, and docs updates
Add CHANGELOG.md and update README docs and image links; tidy .gitignore. Convert modules to ESM-style exports by adding named exports (export { foo }) and replace direct Math destructuring with imports from util.js where appropriate. Small behavioral/safety fixes: validate even N in kaiserBesselDerived, minor ultraspherical iteration fix/optimization, and various window modules adjusted for consistent exports. Update package.json repository/homepage to audiojs. Overall prepares/cleans the package for the ESM v3 release and improves consistency across modules.
1 parent 52c6cd0 commit 8941cea

38 files changed

Lines changed: 125 additions & 104 deletions

.gitignore

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,4 @@
1-
2-
# Directories #
3-
###############
4-
reports/
5-
build/
6-
7-
# Compiled source #
8-
###################
9-
*.com
10-
*.class
11-
*.dll
12-
*.exe
13-
*.o
14-
*.so
15-
16-
# Packages #
17-
############
18-
# it's better to unpack these files and commit the raw source
19-
# git has its own built in compression methods
20-
*.7z
21-
*.dmg
22-
*.gz
23-
*.iso
24-
*.jar
25-
*.rar
26-
*.tar
27-
*.zip
28-
29-
# Logs and databases #
30-
######################
31-
*.log
32-
*.sql
33-
*.sqlite
34-
35-
# OS generated files #
36-
######################
1+
node_modules/
372
.DS_Store
38-
.DS_Store?
39-
._*
40-
.Spotlight-V100
41-
.Trashes
42-
Icon?
43-
ehthumbs.db
44-
Thumbs.db
45-
Desktop.ini
46-
47-
# Temporary files #
48-
###################
49-
*~
50-
51-
# Node.js #
52-
###########
53-
/node_modules/
54-
55-
# Matlab #
56-
##########
57-
58-
# Windows default autosave extension
59-
*.asv
60-
61-
# Compiled MEX binaries (all platforms)
62-
*.mex*
63-
/.claude
3+
*.log
4+
.claude/

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
3+
## 3.0.0
4+
5+
Breaking: ESM-only. `require()` no longer works.
6+
7+
- **34 window functions** (was 18): added connes, powerOfSine, generalizedNormal, planckTaper, exponential, hannPoisson, cauchy, rifeVincent, confinedGaussian, kaiserBesselDerived, dolphChebyshev, taylor, dpss, ultraspherical, parzen, bohman
8+
- **Quantitative metrics**: `enbw`, `scallopLoss`, `cola`
9+
- **Individual files**: `import hann from 'window-function/hann'`
10+
- **Default + named exports**: both `import hann from` and `import { hann } from` work
11+
- **TypeScript declarations** included
12+
- **Scientific SVG plots** for all windows (time domain + frequency response)
13+
- Consolidated to ESM (`"type": "module"`)
14+
- Single `util.js` for shared helpers and utilities
15+
- Zero dependencies (fourier-transform is devDependency for plot generation only)
16+
17+
### Migration
18+
19+
```diff
20+
- const hann = require('window-function/hann')
21+
+ import hann from 'window-function/hann'
22+
```
23+
24+
The per-sample API `fn(i, N, ...params) → number` is unchanged.
25+
26+
## 2.1.0
27+
28+
- Added `apply` and `generate` helpers
29+
30+
## 2.0.2
31+
32+
- 18 window functions: rectangular, triangular, bartlett, welch, hann, hamming, cosine, blackman, exactBlackman, nuttall, blackmanNuttall, blackmanHarris, flatTop, bartlettHann, lanczos, gaussian, tukey

0 commit comments

Comments
 (0)