You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
はじめに S3上の細かいオブジェクト(ファイル)を1つのオブジェクトに連結したい要件がありましたが、色々調べると気にかける事が多く、挙動を理解する目的込みでnpmパッケージを作ることにしました。Pythonのs3-concatにInspireされ、Node.js(TS)で同じことを実現したいと思ったのもモチベーションの1つです。 ESModulesとCommonJSに対応しています。 S3にはMultipart upload機能があります。5GBを超えるファイルはCopyObjectで移動が出来ないため、Multipart uploadを使うケースが多いです。boto3のcopyメソッドは、Multipart upload機能を使っているようです。このMultipart upload機能は、ファイルの結合にも利用可能です。 この背景をベースに以下の理由から、npmパッケージ化することにしま
About twice per year, Node.js contributors and community members get together in an unconference called the Node.js collaboration summit. At the summit, we share knowledge about the project and the ecosystem, brainstorm solutions to technical and non-technical issues, make progress in decision-making discussions, and push forward new initiatives. The first collaboration summit of 2024 was held on
The release of Node.js 21 is available now! Node.js 21 replaces Node.js 20 as our current release line, and Node.js 20 is being promoted to long-term support (LTS). What’s the difference between the two releases? Node.js 21 is great for early feature testing for your own specific environment, while Node.js 20 LTS is for production deployments. Node.js 21 will be ‘Current’ release for the next 6 mo
2024-09-17, Version 22.9.0 (Current), @RafaelGSS New API to retrieve execution Stack Trace A new API getCallSite has been introduced to the util module. This API allows users to retrieve the stacktrace of the current execution. Example: const util = require('node:util'); function exampleFunction() { const callSites = util.getCallSite(); console.log('Call Sites:'); callSites.forEach((callSite, inde
React npm ライブラリ/パッケージの作成入門からnpm公開まで(RollupとTypeScript編) こんにちは、皆さん!今日は、RollupとTypeScriptを使用してReactのnpmパッケージを作成し、exampleディレクトリで動作確認する方法について詳しく説明します。この記事では、初心者でも分かりやすいようにステップバイステップで進めていきます。さっそく始めましょう! React npm ライブラリ/パッケージの作成入門からnpm公開まで(RollupとTypeScript編) 作ったもの なぜ自作のライブラリを作ったか 1. 前提条件 必要なツール 2. プロジェクトのセットアップ ライブラリにはどのようにパッケージするの?(npm rollupもしくはnpm pack?) npm packとは rollupとは 使い方によって用途は分かれる 3. ディレクトリ構
はじめに Vitestには、In-Source Testingというテスト方法があります。これは実装とテストコードを同一のファイルに記述できます。Rustは言語レベルでこの機能をサポートしていたりします。 見栄えの感じ方は、個人差はありますがテストコードが小規模だとメリットを感じる人がいると思います。また、同一ファイルに書くことで、プライベート関数を公開せずにテストできます。Javaは、パッケージプライベートという可視性があり、似たようなことができます。 そもそもプライベート関数をテストするべきか?という議論がありますが、本記事ではテストする方法があることの紹介にフォーカスします。個々のプロジェクトが抱えている問題の解決策として有用であれば採用してみてください。 前提 前提となる環境は以下です。 TypeScript Lambda Node.jsランタイム(ts-nodeのESM実行対応が
こんにちは、戸田です。 このブログではTypeScriptの環境構築からJestを使用した簡単な四則演算のテストの方法を解説します。 環境構築 まずは環境構築をします。 今回はかなりシンプルな環境を構築します。 今回使用した環境は以下です。 Node.js v21.5.0 TypeScript v5.4.0 Jest v29.7.0 TypeScriptのインストール package.jsonをセットアップする npm init -y TypeScriptをインストールする npm install typescript --save-dev Node.jsのプログラムに必要な型宣言ファイルnode.d.tsをインストール npm install @types/node --save-dev TypeScriptの設定ファイルtsconfig.jsonを初期化 npx tsc --init
Over a month ago, we discussed a possible migration to the Node.js test runner. While we were sufficiently happy with Mocha, we are always looking to make our CI jobs faster. Relying on a test runner baked inside our runtime had some advantages for our main monorepo: Two fewer dependencies to install and maintain in our monorepo: mocha and chai. Maintainability: there are more people involved in t
小ネタです、タイトルにはnpm installと書きましたがもちろんnpm startなどにも使えます。 TL;DR npx --package=node@16.20.2 --package=npm@8.19.4 -- npm install 説明 最近はNodeインストール時にデフォルトで一緒にインストールされるnpx、これは例えば npx create-next-app@latest (https://nextjs.org/docs/app/api-reference/create-next-appより など、その場で手軽にnodeパッケージを実行する時に使われたりします。 ところでこのnpxは実行したいコマンドのパッケージのバージョンを指定するオプションがありますが、さらに 実行したいコマンドと別にパッケージのバージョンを指定できる、しかも--packageの書式なら複数OK という
Announcing pkg.pr.new We’re excited to introduce pkg.pr.new, a GitHub app to get instant preview releases of your packages. It allows your contributors and users to test continuous releases of each commit in your project’s main branches and on every Pull Request! We built pkg.pr.new to provide developers with a faster way to work together to test and validate changes. Currently, there is a lot of
A Socket API that works across JavaScript runtimes — announcing a WinterCG spec and Node.js implementation of connect()2023-09-28 Earlier this year, we announced a new API for creating outbound TCP sockets — connect(). From day one, we’ve been working with the Web-interoperable Runtimes Community Group (WinterCG) community to chart a course toward making this API a standard, available across all r
4月4日、Deno Deployが新しいプロジェクト作成フローを発表した。 Deno Deployは、ウェブ上でJavaScript / TypeScriptを簡単かつ高速にデプロイして実行するためのプラットフォーム。 このクラウドベースのサービスは、V8アイソレートクラウドを利用しており、npmをネイティブでサポートしているほか、グローバルに分散されたキーバリューストア、キュー、cronなどの組み込みのクラウドプリミティブを提供している。 新しいプロジェクト作成フローでは、GitHubリポジトリからのプロジェクト作成がより簡単になった。自動的なフレームワーク検出により、GitHubリポジトリとの接続時にフレームワークが自動的に検出され、それに応じて適切な設定が行われる。 また、ビルドステップのオプションが追加され、プロジェクトに応じてビルドが必要な場合は、GitHub Actionsを使
2023-11-14, Version 21.2.0 (Current), @targos Notable Changes [e25c65ee2f] - doc: add MrJithil to collaborators (Jithil P Ponnan) #50666 [f2366573f9] - doc: add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393 [eac9cc5fcb] - (SEMVER-MINOR) esm: add import.meta.dirname and import.meta.filename (James Sumners) #48740 [7e151114b1] - fs: add stacktrace to fs/promises (翠 / green) #49849 [6dbb28
複数のリポジトリで共有する node パッケージを、パブリックな npm レジストリではなく GitHub Packages の npm レジストリに公開して、 GitHub Organization 内でのみ利用可能なパッケージとして扱う手順を、社内共有用にまとめていきます。 本記事の内容は、以下の公式ドキュメントを読めばだいたい分かります。 背景 マネーフォワード クラウドシリーズのデザインシステムを構築しようとしており、複数のプロダクトで共通して利用できる汎用的な UI コンポーネントを揃えたライブラリを各プロダクト向けに公開したい。検証段階なので、一旦 org 内に限定した状態で利用したい。 GitHub Packages とは Introduction to GitHub Packages - GitHub Docs より GitHub Packages is a softwar
Node.js supports 2 different modules. EcmaScript and CommonJS modules. ES modules are the official standard for modules in JavaScript and they are supported by all modern browsers. CommonJS modules are the modules that Node.js uses by default. They are not supported by browsers and they are not the official standard. However, they are still widely used. How does Node.js load the entry point?In ord
AWS Lambda now supports creating serverless applications using Node.js 20. Developers can use Node.js 20 as both a managed runtime and a container base image, and AWS will automatically apply updates to the managed runtime and base image as they become available. You can use Node.js 20 with Lambda@Edge, allowing you to customize low-latency content delivered through Amazon CloudFront. Powertools f
(CC) Blender Foundation | mango.blender.org (c) copyright 2006, Blender Foundation / Netherlands Media Art Institute / www.elephantsdream.org (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org © copyright Blender Foundation | durian.blender.org © copyright Blender Foundation | www.sintel.org Discord for any problems/errors/bugs: https://www.codewithantonio.com/discord Github & Live Web
この記事は AoTo Advent Calendar 2023 6日目の記事です。 TL;DR Next.js のうち、サーバーサイドで動いているモジュール群で Node.js APM を利用する方法をまとめています。 前提として、Datadog Node.js APM には互換性要件が定められており、Next.js は Standalone や AppRouter を利用していている場合に、サーバーサイドのモジュール群をトレース可能です。[1] ただし、愚直に/app/page.jsに対してimport dd-traceのように実装すれば良いのではなく、Node.js APM ライブラリであるdd-traceが Next.js のサーバーサイドモジュール群にインポートされる前にロードされる必要があります。 そのため、最初にdd-traceをロードする方法として、このような方法が考えられま
Programming should be simple. That’s why we made Deno a zero-config, batteries-included JavaScript runtime with native TypeScript support, enabling immediate productivity. In version 1.43, we have enhanced the performance of Deno in IDEs by reducing auto-completion times from 6-8 seconds to under one second in large codebases and significantly decreasing memory usage. We have also achieved more co
重い腰を上げて FlatConfig 対応をした ESLint が新しい設定形式として FlatConfig を導入してから随分と経ち、最新バージョンの v9 では FlatConfig がデフォルトになりました。一方で利用者の多い plugin でもなかなか対応が進まず、周りでは思ったよりも FlatConfig への移行が進んでいない印象を受けます。 とはいえ次のバージョンである v10 では FlatConfig しかサポートしないことが予定されており、今まで移行を見送ってきた方も「さすがにそろそろ移行するか...」と思っているのではないでしょうか。自身の所属チームで管理している ESLint の rule セット : @cybozu/eslint-config でも遅ればせながら FlatConfig 対応を進めています。(現在はアルファ版で提供中です) そんな @cybozu/e
CLI stands for Command-Line Interface. CLIs are often the core tools for automating tasks, such as deploying production applications, running tests, building reports, migrating data, DevOps, and the list goes on and on. If you find yourself doing the same things over and over again, chances are you can automate those steps with a script and save yourself a lot of time. A bad CLI can easily discour
本記事は、以下のエキスパートに監修していただきました: 古川陽介さん(Japan Node.js Association代表理事) この機能のプルリクエストに記載されたコメントによれば、「(Node.jsの)エコシステムを前進させるために重要であり、多くのユーザーが望んでいる。無視することはできない」「外部依存関係やローダーをインストールせずにnode foo.tsを実行したいというユーザーの要望を認める必要がある」と述べられている。 この実験的なフラグは--experimental-strip-typesであり、その名の通りコードから型を除去し、TypeScriptをJavaScriptに変換する。 制限事項 まずは型を除去するための仕組みが入った。enumやnamespaceといった他のTypeScript機能はサポートされない。 tsconfig.jsonファイルの設定は無視される。
Datadog Japanは、最新のコンテナの利用実態の調査レポートを発表した。本調査は、グローバルのDatadogユーザーにより実行されたコンテナデータを年次でまとめているもので、2023年は、同年9月の24億以上のコンテナのデータを対象に「コンテナ利用に関する10のインサイト」と題している。 【もっと写真を見る】 Datadog Japanは、2023年12月21日、最新のコンテナ利用実態についての調査レポートを発表した。 本調査は、グローバルのDatadogユーザーにより実行されたコンテナデータを年次でまとめているもので、2023年は、同年9月の24億以上のコンテナのデータを対象に「コンテナ利用に関する10のインサイト」と題している。 詳細を説明したDatadog Japanのシニアテクニカルエバンジェリスト 萩野たいじ氏は、「コンテナを導入することで3つのベネフィットがある。1つ目
はじめに Node.jsのストリーム書き込み使いますか?私は最近Glueジョブの検証で、Firehoseから出力された大量テキストデータを用意する必要があり、使いました。Firehoseを経由して作っても良いのですが、お金がかかるので、ローカルで1つのテキストファイルを用意して、splitとgzipコマンドで用意しました。 このローカルで1つのテキストファイルを作る際に、以下のエラーが出ました。対処法が検索しても見つからなかったの書くことにしました。 SystemError [ERR_SYSTEM_ERROR]: A system error occurred: undefined returned undefined (undefined) 本エラーは、Node.jsでシステムレベルでエラーが発生しており、具体的な原因はエラーメッセージがないため推測に基づく点とエラーの内容はコードを実行
株式会社ヘンリーでSREなどをやってる戸田(id:eller)です。弊社サービスはBackend for FrontendとしてApollo Serverを採用しています。 先月まではApollo Server v3を利用していましたがEOLが今年の10月に迫っていたため、v4へのアップグレードを実施しました。この記事では移行時に実施したことをご紹介いたします。 なお公式ドキュメントに主な変更点がまとまっていますので、類似の作業を予定されている方はそちらをまずご確認ください。 GraphQL関係の依存を更新する Apollo Server v4は graphql 16.7.0以降の利用を推奨しています。もしいま依存しているバージョンが古いなら、その更新から始めることをおすすめします。 弊社では graphql に加えて @graphql-tools/load と @graphql-tool
4月5日、Bun開発チームはJavaScriptランタイムの新バージョン、Bun v1.1.1をリリースした。このアップデートでは、合計20件のバグが修正され、これらには60の👍リアクションが寄せられていた。 4月5日、Bun開発チームはJavaScriptランタイムの新バージョン、Bun v1.1.1をリリースした。このアップデートでは、合計20件のバグが修正され、これらには60の👍リアクションが寄せられていた。 Bun v1.1.1の主な修正点: Windowsサポートの改善: Windows上でbun installがsharpを正しくインストールできない問題が修正された。これはBun Shellの未実装機能に起因するもので、現在はサブシェルがサポートされている。 JavaScriptCoreのアップグレード: RegExp、型付き配列、StringのindexOfとreplac
7月1日、BleepingComputerが「[開発者が CVE の重大度を拒否し、GitHub リポジトリを読み取り専用にする(Dev rejects CVE severity, makes his GitHub repo read-only)](https://www.bleepingcomputer.com/news/security/dev-rejects-cve-severity-makes-his-github-repo-read-only/)」と題した記事を公開した。この記事では、CVEシステムの功罪について詳しく述べている。 'node-ip' GitHubリポジトリのアーカイブ化 人気のあるオープンソースプロジェクト「node-ip」が、開発者自身の手によってGitHubリポジトリがアーカイブされ、読み取り専用になった。この措置は、CVE報告(CVE-2023-42282
Security News Node.js TSC Confirms: No Intention to Remove npm from Distribution The Node.js Technical Steering Committee has confirmed that removing npm from the Node.js distribution is not a project goal, amidst continued discussions regarding enabling Corepack by default. The Node.js Technical Steering Committee (TSC) met this week and made a few key decisions as part of the broader discussion
viteのlib modeを使ってnpmパッケージを公開する# react# vite先日 react-use-polling を公開したのですが、その際に使用した vite の lib mode が便利だったので記録。 はじめに 今回 library として作成した react-use-polling は、 React の custom hooks です。 本記事は custom hooks を公開する場合の lib mode の使用に関して記述しています。 言語は TypeScript を使用しているため、本記事では TypeScript での環境として記述していきます。 公開したライブラリのリポジトリは、 hey3/react-use-polling です。 lib mode とは vite.config.ts に build.lib を設定すると、ライブラリとしてビルドするというも
ここではnvmについて詳しく学んでいきます。 nvmとは nvmはNode.jsのバージョンマネージャーツールです。こちらを使うと複数のバージョンのNode.jsを切り替えることが可能になる便利なツールです。 nvmのグローバルインストール インストールは以下のコマンドを実行します。 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash 上記のコマンドを実行すると~/.bashrcにnvmの設定が書き込まれていることがわかります。 tail -n 3 $HOME/.bashrc export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く