Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate build from babel to tsup #30

Merged
merged 3 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

15 changes: 0 additions & 15 deletions .editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

36 changes: 4 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,11 @@ pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Editors
.idea

# Lib
lib
# Build artifacts
dist

# npm package lock
package-lock.json
# Others
.DS_Store
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
pnpm-lock.yaml
# Ignore all MD files:
**/*.md

# Ignore artifacts:
dist
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Dineshkumar Pandiyan <flexdinesh@gmail.com>
Copyright (c) 2023 Dinesh Pandiyan <flexdinesh@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
37 changes: 6 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Browser or Node.js

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

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

## Install

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

## Usage

ES6 style import
Import the checks and use it in your code. Works with both ESM and CJS imports.

```js
import { isBrowser, isNode, isWebWorker, isJsDom, isDeno } from "browser-or-node";

if (isBrowser) {
// do browser only stuff
}

if (isNode) {
// do node.js only stuff
}

if (isWebWorker) {
// do web worker only stuff
}

if (isJsDom) {
// do jsdom only stuff
}

if (isDeno) {
// do deno only stuff
}
```

ES5 style import

```js
var jsEnv = require("browser-or-node");
import * as jsEnv from "browser-or-node";
// import { isBrowser, isNode, isWebWorker, isJsDom, isDeno } from "browser-or-node";
// const jsEnv = require("browser-or-node");

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

## License

MIT © Dineshkumar Pandiyan
MIT © Dinesh Pandiyan
12 changes: 0 additions & 12 deletions browser-test/index.html

This file was deleted.

29 changes: 0 additions & 29 deletions browser-test/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions browser-test/package.json

This file was deleted.

32 changes: 0 additions & 32 deletions browser-test/server.js

This file was deleted.

23 changes: 0 additions & 23 deletions browser-test/worker.js

This file was deleted.

5 changes: 0 additions & 5 deletions examples/example.js

This file was deleted.

5 changes: 0 additions & 5 deletions examples/index.js

This file was deleted.