Skip to content

Commit d0ffc36

Browse files
committed
Migrate build from babel to tsup
1 parent 9875469 commit d0ffc36

25 files changed

+1430
-4609
lines changed

.babelrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.editorconfig

Lines changed: 0 additions & 15 deletions
This file was deleted.

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,11 @@ pids
88
*.pid
99
*.seed
1010

11-
# Directory for instrumented libs generated by jscoverage/JSCover
12-
lib-cov
13-
14-
# Coverage directory used by tools like istanbul
15-
coverage
16-
17-
# nyc test coverage
18-
.nyc_output
19-
20-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21-
.grunt
22-
23-
# node-waf configuration
24-
.lock-wscript
25-
26-
# Compiled binary addons (http://nodejs.org/api/addons.html)
27-
build/Release
28-
2911
# Dependency directories
3012
node_modules
31-
jspm_packages
32-
33-
# Optional npm cache directory
34-
.npm
35-
36-
# Optional REPL history
37-
.node_repl_history
38-
39-
# Editors
40-
.idea
4113

42-
# Lib
43-
lib
14+
# Build artifacts
15+
dist
4416

45-
# npm package lock
46-
package-lock.json
17+
# Others
18+
.DS_Store

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
pnpm-lock.yaml
3+
# Ignore all MD files:
4+
**/*.md
5+
6+
# Ignore artifacts:
7+
dist

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018 Dineshkumar Pandiyan <[email protected]>
3+
Copyright (c) 2023 Dinesh Pandiyan <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Browser or Node.js
22

3-
[![Build Status](https://travis-ci.org/flexdinesh/browser-or-node.svg?branch=master)](https://travis-ci.org/flexdinesh/browser-or-node)
43
[![npm version](https://badge.fury.io/js/browser-or-node.svg)](https://www.npmjs.com/package/browser-or-node)
54
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
65

7-
Check whether the code is running in the browser or node.js runtime.
6+
Check in which environment the code is running - browser/node.js/webworker/jsdom/deno.
87

98
## Install
109

@@ -14,36 +13,12 @@ $ npm install --save browser-or-node
1413

1514
## Usage
1615

17-
ES6 style import
16+
Import the checks and use it in your code. Works with both ESM and CJS imports.
1817

1918
```js
20-
import { isBrowser, isNode, isWebWorker, isJsDom, isDeno } from "browser-or-node";
21-
22-
if (isBrowser) {
23-
// do browser only stuff
24-
}
25-
26-
if (isNode) {
27-
// do node.js only stuff
28-
}
29-
30-
if (isWebWorker) {
31-
// do web worker only stuff
32-
}
33-
34-
if (isJsDom) {
35-
// do jsdom only stuff
36-
}
37-
38-
if (isDeno) {
39-
// do deno only stuff
40-
}
41-
```
42-
43-
ES5 style import
44-
45-
```js
46-
var jsEnv = require("browser-or-node");
19+
import * as jsEnv from "browser-or-node";
20+
// import { isBrowser, isNode, isWebWorker, isJsDom, isDeno } from "browser-or-node";
21+
// const jsEnv = require("browser-or-node");
4722

4823
if (jsEnv.isBrowser) {
4924
// do browser only stuff
@@ -68,4 +43,4 @@ if (jsEnv.isDeno) {
6843

6944
## License
7045

71-
MIT © Dineshkumar Pandiyan
46+
MIT © Dinesh Pandiyan

0 commit comments

Comments
 (0)