diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c8c503f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "13:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a838888 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +name: Test + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test diff --git a/.gitignore b/.gitignore index be2ee44..76b1021 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -artifacts/ -coverage/ -node_modules/ +.nyc_output +coverage +node_modules diff --git a/.npmignore b/.npmignore index c22b205..eb37f27 100644 --- a/.npmignore +++ b/.npmignore @@ -4,3 +4,6 @@ test/ .gitignore .npmignore .travis.yml +.nyc_output +.vscode +.github diff --git a/.travis.yml b/.travis.yml index 61e4237..ac233c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,4 @@ language: node_js node_js: - - "0.10" - - "0.12" - - "4" - - "5" - - "6" + - "10" + - "12" diff --git a/README.md b/README.md index 9c0081b..3d03c2e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Serialize JavaScript ==================== -Serialize JavaScript to a _superset_ of JSON that includes regular expressions and functions. +Serialize JavaScript to a _superset_ of JSON that includes regular expressions, dates and functions. [![npm Version][npm-badge]][npm] [![Dependency Status][david-badge]][david] @@ -11,9 +11,13 @@ Serialize JavaScript to a _superset_ of JSON that includes regular expressions a The code in this package began its life as an internal module to [express-state][]. To expand its usefulness, it now lives as `serialize-javascript` — an independent package on npm. -You're probably wondering: **What about `JSON.stringify()`!?** We've found that sometimes we need to serialize JavaScript **functions** and **regexps**. A great example is a web app that uses client-side URL routing where the route definitions are regexps that need to be shared from the server to the client. +You're probably wondering: **What about `JSON.stringify()`!?** We've found that sometimes we need to serialize JavaScript **functions**, **regexps**, **dates**, **sets** or **maps**. A great example is a web app that uses client-side URL routing where the route definitions are regexps that need to be shared from the server to the client. But this module is also great for communicating between node processes. -The string returned from this package's single export function is literal JavaScript which can be saved to a `.js` file, or be embedded into an HTML document by making the content of a `