Built on a modular architecture and designed with simplicity in mind, it empowers developers to quickly create powerful applications.
Node.js Docker baseイメージには alpine < distroless < ubuntu+slim 構成がよさそう はじめに この記事は、DockerCon 2022 で発表された Bret Fisher の "Node.js Rocks in Docker, DockerCon 2022 Edition" を参考にしています。 base イメージの選択肢に関する話は、動画の前半一部分だけですが、他にも Node.js で Dockerfile を書く時のベストプラクティスが数多くまとまっているので、是非チェックしてみてください。 node:alpine イメージを使わない base イメージサイズを小さく保ちたい、という点で気軽に利用される事が多い alpine イメージですが、Official の README には下記の記載があります。 This variant
うりうりさんの↓のコメントを見て、そういえばnpm ciって見たことあるけどチェックしてないなぁ。というかnpm installも雰囲気で使ってるなぁ。と思ったので、うりうりさんに教えてもらったことを手がかりに、npm installとnpm ciについて調べた。 これ、node_modulesキャッシュしてたり npm install使ってるけど npmのグローバルキャッシュ(~/.npm)をキャッシュした上で npm ciで早くなったりしないんだろうか GitHub Actions上でテストを約3倍早くした話https://t.co/MpmFktGBxU— wreulicke (@wreulicke) March 14, 2023 ちょこっと検索して見てみたところ、新旧情報があって自分が混乱したのと、公式ドキュメントには概要は書かれているものの詳しい内容は書かれていないので(僕が見つけ
Domain-first DevelopmentHerbsJS is a domain-first development framework (non-MVC approach), that allows you to build maintainable applications by using the same language and terms as your stakeholders. Low-code InfrastructureREST and GraphQL endpoints running on the same project. Move your data transport layer without changing your code. That's the magic of a domain-first development. AI-AssistedW
Run JavaScript EverywhereNode.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts. Download Node.js (LTS)Download Node.js (LTS)Downloads Node.js v20.12.11 with long-term support. Node.js can also be installed via package managers.Want new features sooner? Get Node.js v21.7.21 instead. // server.mjs
Zero-config Write backends, apps or libraries while minimizing configuration and boilerplate. Serverless Ready Produce compiled and minified builds for faster download from npm and quicker cold starts on serverless environments. Feature Rich Live-reload, errors diagnostics, missing dependencies autoinstall, import/export syntax...
Fastify 速いですね Express が hapi より遅いのは意外でした Koa は本体だけだと Express 以上に何もしないので その分速めです よくみると驚きなのが http.Server より Fastify が速いというところ http.Server はフレームワークを使わない Node.js 自体の API です Koa や hapi はこれを中で使っています これより速いということは Fastify は http.Server は使わずに net などを使って ソケット通信部分を直接操作しているのでしょうか? http.Server を使ってない?Fastify のソースコードを見た限りでは 特に設定をしなければ http.createServer でサーバを作成しています つまり http.Server を使っています https://github.com/fas
pprof って go のやつでしょ? node のプロファイルが取れるわけ無いやろ,と僕も思っていたんですが以下のライブラリを使うことで取れることがわかりました. github.com 使い方については Using the Profiler に書いてあるとおりで,アプリケーション側に const profile = await pprof.time.profile({ durationMillis: 10000, // time in milliseconds for which to // collect profile. }); const buf = await pprof.encode(profile); fs.writeFile('wall.pb.gz', buf, (err) => { if (err) throw err; }); という風に書いてあげるとwall time
フロントエンドのパフォーマンス計測は得意なのだが、サーバーサイド node.js のメトリクスの取り方はあまり知らなくて、いつも勘でやりがちだった。最近は業務でこの周辺で困ることが増えたので、勉強しなおした。 また、最近使ってみたかった cloudflare workers の制限で、メモリ 128MB、CPU 時間 50ms という制約があり、このためにも Node.js の CPU のメトリクスを計測できるようになっておく必要があった。 という目的を踏まえて、今回は OS やデータベースの最適化は扱わず、ネットワークとアプリケーション層だけに絞って学習した。あと仕事の Docker イメージのサイズにも悩んでたので、ここも。 (あと ISUCON 参加者が楽しそうだったのもある。 ISUCON のチューニング対象にフロントエンドは含まれないので…) 計測対象 今回実験したリポジトリはこ
// app.js const path = require('path'); // optional const ms = require('ms'); const dayjs = require('dayjs'); const Graceful = require('@ladjs/graceful'); const Cabin = require('cabin'); // required const Bree = require('bree'); // // NOTE: see the "Instance Options" section below in this README // for the complete list of options and their defaults // const bree = new Bree({ // // NOTE: by defaul
GraphQL Nexus' APIs were designed with type-safety in mind. We auto-generate type-definitions as you develop, and infer them in your code, giving you IDE completion and type error catching out of the box! Nexus can work with existing graphql-js types when constructing its schema. The generated schema works with your favorite tools like Apollo Server or GraphQL middleware.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く